What to do if you have wordpress error message which is :”Error establishing a database connection”.
Yesterday, I was in the middle of checking my dashboard and when i refreshed my admin page, my screen was suddenly white and showing this database error message.
This has never happened to me before, and i was then, of course panic.
The error message looks like the following image:
I started to backup my wordpress database from my phpMyAdmin, and start to do some google researches about it too. Luckily a few minutes later, my blog comes back online again.
Here are some steps what i did when i got this database error:
1. I tried to be not panic, but of course i was. Can’t help it, i have lots of posts already, and do not want to loose anything. So i did a quick database backup before i could think of something else.
2. I was so sure that my database name, password, localhost were all correct. So i didn’t even touch my wp-config.php.
3. I tried to settle down, and wait for a few minutes, planned to contact my host, but i just have waited.
4. Finally after a few minutes later, my blog was back to normal again. I didn’t do anything, i have just waited.
Summary: If you have this problem, and you are sure you didn’t edit wp-config.php file, then i would just wait for a few minutes or hours (24 hours). In my case above, imagine, if i changed something, it would mess up my blog instead of fixing. So i would recommend you wait until the next day, and if it still happens, i would contact your webhost.
Hello KIMI,
I come here because i’m looking for a solution for a real problem. Your case is very popular because that may only be cause of your blog not cached and so it overloaded the mySQL allowances.
However currently I encounter this message for all my blogs and meo.vn is one case. I had to fix it by renaming the tables of the first blog one by one from wp_1_xxx to wp_xxx.
I’m in hope of having a real solution as a php file or something. Hopefully one of your visitors know about it. Thanks in advance.
Hi Binh,
I have encoutered this many times, in my old free hosting, and once or twice with this blogs.
But I guess it was caused by the host, because I did not change anything and a few minutes later it works again, I am glad I did not touch database though, because non-savvy person like me, can do big mistake with database!
But in your case, I am sure learning something new, and I hope that will never happen to me or anyone else.
Thanks for the explanation!
Kimi.
Hi Kimi, I am experiencing this at the moment, and going through the panic stage as nothing is loading. I will have to bite my lip and take your advice to do nothing for now. Hopefully it is something to do with the host, its late at night so I guess it could be some sort of maintenance.