• I want to have wordpress installed on 1 server and mysql running on a different server. On the mysql server, i have created the database and assigned a username and password. When trying to run the /wp-install/install.php file, i get this error:
    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at <server.name>. This could mean your host’s database server is down.

    * Are you sure you have the correct username and password?
    * Are you sure that you have typed the correct hostname?
    * Are you sure that the database server is running?
    Can anyone help in this issue? Thanks

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • reading documentation is important, regardless of which publishing you’re trying to dabble with. I’m sure you know that well. ??

    with that in mind, have a look at https://codex.www.ads-software.com/Installing_WordPress

    quick notes regarding wp-config.php

    // ** MySQL settings ** //
    define(‘DB_NAME’, ‘wordpress’); // The name of the database
    define(‘DB_USER’, ‘username’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘password’); // …and password
    define(‘DB_HOST’, ‘ip-of-the-machine-running-mysqld’);

    Thread Starter carnold

    (@carnold)

    Umm, yea, reading is good ??
    I also have tried that, define(‘DB_HOST’, ‘ip-of-the-machine-running-mysqld’); instead of hostname. Still does not work. Still gives me the same error. It is possible to run WP 2.0 on 1 server and mysql on another server, right?
    I run WP 2.0 and mysql on my servers and full access to all of them. So, when i run mysql from the command line, i enter a username and password. This username and password is the same as i enter into the WP information.
    Chris

    can you verify that the remote machine is actually running mySQL and able to accept connections from/to the machine hosting the WordPress site?

    is the database itself configured to accept connections from the IP address of the machine hosting WordPress (or any address) NOT localhost?

    if so, does wp-config.php reflect the correct IP address of that machine?

    I found I needed to create the user as explicitly allowing connection from ‘localhost’ rather than ‘anywhere’. MySQL has an odd permissions system.

    Thread Starter carnold

    (@carnold)

    rpm -qa | grep mysql produces:
    mysql-shared-4.0.18-32.1
    perl-DBD-mysql-2.9003-22.1
    mysql-client-4.0.18-32.1
    mysql-4.0.18-32.9
    Verification that mysql IS installed. Next, to verify it is accepting connections: telnet <servername> 3306
    Trying <ip address>
    Connected to <hostname>
    Escape character is ‘^]’.

    4.0.18,&b=I#?TConnection closed by foreign host
    So the answer to that qusetions, is NO, it does not look like it accepting connections to/from any host.

    Quote-is the database itself configured to accept connections from the IP address of the machine hosting WordPress (or any address) NOT localhost?
    Edit-A netstat -ant | grep 3306 produces:
    tcp 0 0.0.0.0:3306 0.0.0.0″*
    Is this what you were asking?-Edit
    Not sure about this as on the last machine i installed, i did not have to do anything like this.
    Yes, wp-config reflects the correct address of this mysql machine.

    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can not connect to database’ is closed to new replies.