WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection (23 posts)

  1. netwmarket
    Member
    Posted 7 years ago #

    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?

  2. DianeV
    Member
    Posted 7 years ago #

    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.

  3. avnerengel
    Member
    Posted 7 years ago #

    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

  4. drmike
    Member
    Posted 7 years ago #

    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.

  5. avnerengel
    Member
    Posted 7 years ago #

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

    Thanks

  6. eclecticparent
    Member
    Posted 7 years ago #

    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.

  7. DianeV
    Member
    Posted 7 years ago #

    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.

  8. 4k
    Member
    Posted 7 years ago #

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

  9. eclecticparent
    Member
    Posted 7 years ago #

    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.

  10. DianeV
    Member
    Posted 7 years ago #

    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.

  11. mhergaarden
    Member
    Posted 7 years ago #

    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

  12. Coder1999
    Member
    Posted 7 years ago #

    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.

  13. webnovice
    Member
    Posted 7 years ago #

    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?

  14. Samuel B
    moderator
    Posted 7 years ago #

  15. betsyrking
    Member
    Posted 6 years ago #

    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

  16. ermo04
    Member
    Posted 6 years ago #

    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.

  17. vanina
    Member
    Posted 6 years ago #

    I can´t even put my username and password. I only put the link of colorsmagazine, and appears this message. The page doesn´t allow me to put anything

  18. robcl894
    Member
    Posted 6 years ago #

    Today on trying to run wp-admin/install.php i got the exact same result as netwmarket 6 months ago.

    I modified wp-config.php more carefully, reran the install, gave it my blog title and my email address when requested, and then it was all over in a second or two !
    Success !

    The problem was that the cpanel username was being prefixed to the database name and the database username, and one of them ended up being too long and was truncated.

    I will detail the steps for those who use cpanel and the mySQL icon -

    1. creaate a new database - say wpdb
    2. create a new user - say rc
    3. add user rc to database wpdb with ALL privileges.

    Now at the top of the same page (entitled by the way - MySQL Account Maintenance) you will see a "Connection String" for PHP. In these lines you will be able to pick out whether to use 'localhost' or not.
    You will see the database name and database username in full, and the password.

    These are the values to use in your wp-config.php

    Best of success,
    Rob Clancy

  19. bignjr
    Member
    Posted 6 years ago #

    I was running word press for 4 months with no problem and all of the sudden I get this same problem as you guys are having.
    I contacted my web hosting servicer and they said "Hello, The problem was on our side, there was a misconfiguration of the DB Server. Accept our apologies for any caused inconvenience." They ended up fixing the DB Server (if that was the problem) yesterday BUT today I am having the same problem.

    I have not changed the user name, passwrd, or host address from my admin file therefore I dont see how it could be a misconfiguration from my part.

    I know my web hosting told me it was their fault but I cannot wait days for them to finally fix it correctly. Any ideas??

  20. ramasan
    Member
    Posted 6 years ago #

    arg! i am having the same issue as bignjr. i have been running blog on 2.2.3 for 18 months. i did some minor poking around - the only thing of significance (and i realize this may have caused it) is i activated and ran a backup using the backupwordpress plugin - an older one - 0.2.5 (if i remember correctly).

    i logged in just after and i got the above error from the home page.

    my wp-config hasnt changed in over a year. it has NOTHING to do with that file. it either has something do to with the backup i ran or amazingly something happened on the providers DB (1and1.com) at magically the same moment.

    in my fooling around, i have deleted .htaccess, slightly changed the password on the db through the control panel for my ISP and then changed it correspondingly on wp-config (yes they are exactly the same now).

    man i am PEE - O'd.

    i am going to have to start praying that my full and sql backup from backupwordpress actually works and install to a dummy account.

  21. itsfridaymoanin
    Member
    Posted 6 years ago #

    While installing a local version on my iMac G5, the db host had to be set to "127.0.0.1" as did the host permissions for that user in mysql.

  22. jmintia
    Member
    Posted 6 years ago #

    you should correctly type the Mysql hostname of your web server. like for instance, i created an account on Byethost.com web hosting service and they gave me account details for my Mysql hostname which is "sql105.byethost13.com". This should be the 'DB_Host' value and not 'localhost'.

  23. kmessinger
    Volunteer Moderator
    Posted 6 years ago #

    I think it is best not to reply to these posts that are months and even 4 days old. The issue is closed by no additional communication from the originator.

    If someone has a question they should post a new message. Many respond to the 1 message but for me, if I see 58 or what-ever I stay away.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags