• Resolved calibereq

    (@calibereq)


    Error Message:

    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 localhost. 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?

    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    I have entered all information into the wp-cofig.php file- at least as far as I can tell. The only extra bit of information I have is the IP address of my server for logging into MySQL- should I use that instead of ‘localhost’? The IP address is: mysql1.hostingplatform.com

    Although, I am in doubt of that being the problem as I am able to log into phpMyAdmin and this massage is displayed at the top of the page:

    Welcome to phpMyAdmin 2.7.0-pl2

    MySQL 4.1.21 running on localhost as calibereq@localhost

    Any help is appreciated! Let me know if any other info is needed 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter calibereq

    (@calibereq)

    Please, can anyone help?

    Thread Starter calibereq

    (@calibereq)

    In the wp-db.php file located in the subfolder “wp-includes” I added the little string of code:

    echo (mysql_error());

    right after:

    $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);

    So that the code looks like:

    $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
    echo (mysql_error());
    if (!$this->dbh) {
    $this->bail(sprintf(/*WP_I18N_DB_CONN_ERROR*/”
    <h1>Error establishing a database connection</h1>
    <p>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 %s. This could mean your host’s database server is down.</p>

    • 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?

    <p>If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.</p>
    “/*/WP_I18N_DB_CONN_ERROR*/, $dbhost));
    return;
    }

    And now there is additional information on what is going wrong:

    Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)

    Guys I had a similar problem.It went away after DB_HOST to 127.0.0.1 instead of using localhost

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.