Support » Installing WordPress » Error establishing a database connection

  • I created a database and uploaded WP2.0 to my server. When I try to install 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 DB_HOST. 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.
    ==========

    Now I’ve searched these forums and have seen this problem mentioned elsewhere within them, but have yet to see a satisfactory explanation or fix for the problem. I have checked and re-checked to make sure that the database name, user name, and password are all correct. I know that the database server is working. So, does anybody have an idea of how to fix this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • “but have yet to see a satisfactory explanation or fix for the problem.”
    There are lots – they just vary.

    Are you using cpanel / vdeck / ensim or plesk control panel on your webhost ?

    Thread Starter WL

    (@wl)

    vdeck

    Are you sure you’ve got a database created and can log into it using something like phpMyAdmin?

    Thread Starter WL

    (@wl)

    >Are you sure you’ve got a database created and can log into >it using something like phpMyAdmin?

    Positive. There are no tables in it, but I can log into it.

    >http://www.tamba2.org.uk/wordpress/vdeck/
    >those help ?

    After it didn’t work the first time, I followed the instructions on the site you pointed out and got the same results.

    In that case, if you are absolutely certain that your username and password are correct, it’s the ‘localhost’.
    It is definitely one of those 3 though – with that error message it cannot be anything else.

    Thread Starter WL

    (@wl)

    The hostname issue was the first thing I checked, but it’s fine. LIke the tutorial you mentioned says, it comes out @localhost.

    >It is definitely one of those 3 though – with that error
    > message it cannot be anything else.

    Yes, I know. That’s why it’s driving me crazy. All 3 match completely. Maybe I’ll try again in the morning. I’ve been at this too long tonight.

    Thanks for your help!

    Check your username ?
    Sometime it has to be domain_username, or database_username ?

    Thread Starter WL

    (@wl)

    Yes, did that. This is the first of 5 databases I’ve created in my domain that has pulled this stunt on me.

    Maybe I’ll just delete out the files and install 1.5. My hoster has a script that installs it automatically.

    I had the same problem as you. Previously, I had been able to install a wordpress on my webserver but this time I am really don’t know why it simply doesn’t work. I tried almost 10 times by deleting all the files upload then install again but still fail. Anyone know why??

    To determine if it is WordPress or not; upload a simple php script that contains this:

    <?php

    $database = '...';
    $username = '...';
    $password = '...';

    $link = mysql_connect('localhost', $username, $password);
    if (!$link) {
    die('Not connected : ' . mysql_error());
    }

    $db_selected = mysql_select_db($database, $link);
    if (!$db_selected) {
    die ('Cant open db: ' . mysql_error());
    }
    ?>

    Replace the … in the first three variables (database,username,password) with the relevant values.

    That will tell you if you’ve got the right database, username and password.

    See MySQL 5.0 Reference Manual for explaination at:
    http://dev.mysql.com/doc/refman/5.0/en/old-client.html

    Steps to fix:

    1) Open MySQL Command Line Client.

    2) Enter your MySQL ‘root’ password.

    3) Enter the following command using your wordpress account and password.

    mysql> SET PASSWORD FOR
    -> wordpress@localhost = OLD_PASSWORD(‘wordpress password’);

    Thread Starter WL

    (@wl)

    jaredquinn: I get no results from your script at all

    wmccole: MySQL keeps telling me that the command you gave me has a syntax error, but it matches the documentation so I don’t see where it is.

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