WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection (14 posts)

  1. WL
    Member
    Posted 8 years ago #

    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?

  2. Mark (podz)
    Support Maven
    Posted 8 years ago #

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

  3. WL
    Member
    Posted 8 years ago #

    vdeck

  4. jaredquinn
    Member
    Posted 8 years ago #

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

  5. Mark (podz)
    Support Maven
    Posted 8 years ago #

  6. WL
    Member
    Posted 8 years ago #

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

  7. Mark (podz)
    Support Maven
    Posted 8 years ago #

    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.

  8. WL
    Member
    Posted 8 years ago #

    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!

  9. Mark (podz)
    Support Maven
    Posted 8 years ago #

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

  10. WL
    Member
    Posted 8 years ago #

    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.

  11. badboyx
    Member
    Posted 8 years ago #

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

  12. jaredquinn
    Member
    Posted 8 years ago #

    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.

  13. wmccole
    Member
    Posted 8 years ago #

    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');

  14. WL
    Member
    Posted 8 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic