Support » Installing WordPress » Error establishing a database connection

  • Kindly help me resolve this error message below;

    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

    What can I do please?

Viewing 15 replies - 1 through 15 (of 22 total)
  • Find out whether you have the correct:

    – username
    – password
    – hostname (“localhost” or your domain name)
    – database name

    If you’re not sure, contact your web host.

    These go in the wp-config.php file.

    Hi,
    I double checked the username, password, database name and hostname and I still get the same error message as above?

    Could anyone please help?

    Cheers

    You maybe that 1% that needs to use an actual URL for your database host name instead of localhost. You may need to check with your host about that.

    I tried changing the host name but I got the same error message. Any other ideas of why it is not working?

    Thanks

    I’m waiting to see if you get an answer. I’m having the exact same problem (including double checking all my info was correct) and I’m still getting the same message.

    Hopefully someone will give us an easy solution.

    The only reason I know of that this happens is that:

    1) wrong database name
    2) wrong username
    3) wrong password
    4) wrong host name

    The host name would either be “localhost” or yourdomainname.com (technically speaking, not the URL, which would start with “http” — although I know what you meant, drmike).

    If whatever you put into the wp-config.php file doesn’t work, and you’ve tried the above, we can’t really guess any further — you need to contact your web host to ascertain the correct information.

    have you triple checked to ensure there isn’t a space between anything you added and the single quote marks?

    Avnerengel, like I’d written before, I’m having the exact same problem. Just got a different piece of advice from tech support you might want to try. They told me to delete everything, wait 30 minutes for it to clear (whatever that means) and then reinstall in a different directory.

    I’m in the waiting 30 minutes part so I’m not sure it’ll work but at least it’s a new thing to attempt.

    Really, if you can’t connect to the database, it’s because you’ve put the wrong information in the wp-config.php file. It doesn’t matter *what* directory you install WordPress in; wrong information is wrong information.

    Unless, of course, your tech support didn’t set up the database until after you talked to them. It could happen.

    Hi there,

    I’ve had the same problems over 3 days long….
    Here’s my solution; de-install MySQL components from your host, Re-install MySQL and evrything works at once 😉

    Don’t ask me what changed, but it worked for me

    I was having the same issue and then I ran across two things that got me running:

    1. My webhost has a delay built into their MySQL engine wherein when a new databae is created there is a lagtime before it becomes available to the user. In my case this was about 30-minutes YMMV.

    2. The ‘localhost’ value did have to be changed to ‘NYSESHARED5.HOSTING.COM’ or something like that as my site runs on a shared linux host.

    Once the wait was over nd I got the correct server address installed it is running perfectly.

    Well it seams that this problem has yet to be resolved. I started trying to setup WordPress yesterday and it still has yet to find the database. (hence the following 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 mysql123.hosting.earthlink.net:3306. 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.

    Help! I need to get this thing working. I have setup my SQL database over 4 hours ago and yet I can not connet the wordpress software to it. I am able to manage and end the database from the SQL control panel. Why is wordpress not getting to it?

    If anyone is still looking for the answer to this thread, I had the same problems but continued to mess with it. the problem seems to lie with Earthlinks MySQL. No documentation states that you have to go into the database you have created for the wordpress blog and drop all the tables. This cleans out the database so a new one can be written. Keep in mind, I am doing a new installation (not trying to keep any data from a previous blog – so be careful what you’re ‘dropping’). Once I dropped eerything, wordpress took me through a brand new install when I went to wp-content/install.php

    I checked my input and I still get this error. Can I check if the database can be reached any other wat then the wordpress install page?

    I changed the database host name but that gave no result.

    moust.nl
    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 moust.nl.
    This could mean your host’s database server is down.

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

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