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.

Update: My blog was broken once again, with that error. This time some more was involved. See my second article: https://mic.st/blog/error-establishing-a-database-connection-and-how-to-fix-this/

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. Required fields are marked *

Privacy Overview
mic.st

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.