Categories
Wordpress

How to fix “Error establishing a database connection”

TLDR: Try doing a “Powercycle”, i.e. shutdown and restart your server. I had a button for that in my server’s control panel.

Yesterday night, I updated some WordPress plugins. Everything seemed to have went well, so I closed my laptop and went to sleep.

This morning, I was welcomed with a message showing “Error establishing a database connection”. On the wp-admin path there was some more explanation but all of this did not help. Obviously, I did not change any SQL login credentials so having a look at wp-config.php to check these as recommended seemed useless (and it was).

I tried to login to my SQL database via command line which also did not work. I just got some socket error. Googling this, lead to more stuff that did not work. I tried to stop and restart my MySQL server which also did not work. Luckily, I did not try everything recommended there, as some would have easily destroyed everything (I guess).

So, long story short: The easy solution was to login to my server’s control panel and push that “Powercycle” button:

Section in Netcup’s “Customer Control Panel” to do a powercycle.

Sometimes it’s way easier than expected.

Just pull the plug.

Leave a Reply

Your email address will not be published.