“Error Establishing a Database Connection” — How to Fix This WordPress Error
“Error Establishing a Database Connection” — How to Fix This WordPress Error: Part 1 of 2
“Error Establishing a Database Connection” — How to Fix This WordPress Error: Part 2 of 2
Related posts:
- How to Import a Large WordPress Database — An Alternative to phpMyAdmin Tweet IMPORTANT MESSAGE: If you use the Bigdump script I...

No Worries…Got it now…sadly just started from scratch, then of course found my simple mistakes css feeds weren’t in right place…..
However, want to give you kudos again for your excellent teaching and communicating style….good for us non-techies….I’ll be back to check on your wisdom!
At least here you gave me a good jumping off point for commonsense troubleshooting..lessons learned!
Thanks Again!
The Maven
Life Saver..thank you
Great Video, its help me to remove the error
Thanks
you’re a godsend.
Thanks, it worked perfectly.
hi; i am having this problem but it is transient; some times it just takes time to load but other times the site just wont load. config file is fine
@saurabh: That is a server problem losing connection to the db, not a setting problem…you will need to contact your host about that.
I really appreciate. It helped me !
I was moving my blog to new host !
thanks for the videos. I checked everything and the config file is fine with all the right information. I am no longer getting a database connection error, just a blank screeen. Hosted at Godaddy. Can you help
thx
craig
Thanks a million! I fixed it. Just to add for anybody else: I had to assign a password when I used phpMyadmin and that changed the database password.
Nice tag cloud.
Thank you, big help…I just needed to create a new username with all privileges. Strangely the first one created did not have all privileges.
i am in very tension for 1 day that how to solve this problem but u really help me..thanx
Big Thank you , this fixed a very annoying problem as I’d overwrite the wp-config.php file.
Awesome!!! Thanks
HUGE THANKS. Been struggling with this error message on my boyfriend’s blog. Come to find out something much worse had happened with his blog. All of his .php files were wiped out somehow. But I wouldn’t have noticed that if it hadn’t been for your vids showing to check them. Now I just have to figure out how to get his .php files back. Or somehow recreate them.
very informative, my site sometime shows ‘error database connection’, but it will automatically go back to normal after few second, do you know what caused the problem? is it because of server heavy load? or something related to hosting configuration? i am using wp 3.1.1
@David: Yes, if it’s intermittent then it’s not a WP config issue, it’s a server connection issue…for some reason it’s losing the connection to mysql–most likely a load issue.
I have two WP installs on my POWWEB server in different directories with two different databases. Today both started giving the ‘Error establishing a database connection’ message. I checked the DB names etc. and they are all fine for both sites. Does this indicate a DB problem? I can log in and view the DB tables online in POWWEB’s control panel. I sent a request to POWWEB but I’m guessing that they won’t be much help.
I just want to rule out that it could be the WP installs before I mess with anything. Please let me know what you think.
Helped me!
Saved my life also! Thanks. Needed to change this because of a malware injection!
Big thanks!
I had a WP site that wasn’t coming up at all, and I had lost the documentation on the user password. Created a new user per the video, plugged it all into wp-config.php, and I was able to get my commerce site back up and selling!
Thanks!
zac
Thank you for this post. I purchased a web site and attempted to transfer it to my host myself. This was the error I got. Sure enough the name, user, and password were all configured under the builder’s name. Adding a new user with my own settings fixed the problem. Thank you!
Thank you so much! Your video was very informative and got right to the root of fixing my site after an update!
Really appreciate it.
Andy
Hi i have tried doing all the things on the video but i keep getting the message
Error Establishing a Database Connection??
i really dont know what to do can any one help?
thanks
thank you the problem is solved thank you againe
What a great post! You’re an excellent teacher and solved all my problems with this tutuorial. Thanks so much. I’m just stumped as to why it happened in the first place; I’m thinking it may have something to do with updating WO from simple scripts inside my host instead of from within wordpress? Will stick to the latter from now on if that’s the case…
Just a quick note about the wordpress multi-site feature (I recently ran into an error but managed to fix it).
You will need to edit all instances of the MySQL tables:
wp_blogs (Browse > domain) for each site
wp_options (Browse > siteurl) plus wp_1_options, wp_2_options (depending on how many sites you have, this may be be more).
To troubleshoot, you can also go to and get a bit of debug info.
I am having this very problem. I migrated my sites to a new host and lost the database connection on several sites. I have tried setting up new user and now I don’t even get the error message just a blank page. I have checked new installations of wordpress on this host and localhost is correct. At the end of the second video you mention tables. How do I work on this as a possible issue?
I am totally baffled and really hoping not to rebuild the sites.
Thanks!
Hello all,
If you have been locked out of your cpanel is there any way to get access to it?
I want to reinstall wordpress but can’t get into cpanel. I have tried it through my host and can’t get in that way eater.
Thanks. Kerry
No..need to contact your host to get access to Cpanel.
Didn’t work for me
Damn i begin to hate GoDaddy
Thank you! This was so helpful!
Hi, I have same problem.. I changed my username in my godaddy host server then when I check my website this error appeared ‘ Error establishing a database connection;’ PLS help.. I feel no way to go..
Thanks a lot it saves my life your post was very usefull
Thanks a million – been banging my head all day to sort out this message and fixed it in 30 secs after seeing your vid.
Thank you! Thank you!
Figaro, you should be awarded the noble peace prize. It brought me the world of peace after a night of higly tense solution searching.
Somehow the password for the username changed (most probably). I tried the solution no.3 – created a new username and password; It just worked.
Now for searching how that got reset by itself. I had not touched a thing on my blog for weeks – just upgraded to wordpress 3.3; if that is a reason.
A 2009 solution works in the christmas of 2011. Merry Christmas!
Thank you, thank you.
Thanks so much for the video. It helps non techies like me alot. My problem is I ve done all the cahnges but somehow all I get is a blank screen.
I’m getting the same thing. I just moved my blog to a new host. Did you ever figure it out?@Craig White
I was struggling with the answer but your info saved me after 2 days trying to fix it…moved form one server to another server and never realized the DB were wrong.