Support » Localhost Installs » install.php cannot access DB in DMZ

  • I am getting the “Error establishing a database connection” when trying to install WordPress. I am trying to install using Firefox on my Win7 box on our LAN.
    I have a CentOS box in our DMZ with mysql installed. I have created a DB for WordPress and can access it from a CentOS box on my LAN. I can login, create tables, and insert data. However, I can’t get the install.php to connect to the DB. I’m sure I have the correct DB name, username and password. For the database host, I’ve tried localhost as well as its IP address, 192.168.0.xx.
    Any help would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m not sure I understand your setup.

    Are you planning on running WordPress on the CentOS box? If so, then using localhost as your DB_HOST is the right way to do it.

    If you’re planning on running WordPress on your Win7 box, but with the database hosted on the CentOS box, then the IP Address is how you would do it. Likely the issue in this case is that there’s some sort of firewall mechanism that’s stopping outside connections to your database.

    Maybe something like this will work:

    Still stuck on this issue.
    Just to clarify, I am running the DB and WordPress on the same server in the DMZ. From my browser(FireFox on Win7) I can run intall.php, but it can’t connect to the DB. From a linux box on our LAN, using mysql client, I can connect, create tables, insert data just fine. Also, I put a small php script on the DB server that connects to the DB. I can access that from my browser just fine. The php script I tested is below.
    Any suggestions?

    $link = mysql_connect('192.168.0.xx', 'wpadmin', 'goodPassword');
    if (!$link) {
        die('Not connected : ' . mysql_error());
    // make foo the current db
    $db_selected = mysql_select_db('wpdb', $link);
    if (!$db_selected) {
        die ('Can\'t use wpdb : ' . mysql_error());
    echo "Connected"

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘install.php cannot access DB in DMZ’ is closed to new replies.