Error establishing a database connection on Contabo VPS

I have 4 WordPress websites hosted by Contabo VPS, one day one of the websites could not be accessed with the message “Error establishing a database connection”.

When I checked with other websites on the same server I found all experiencing the same error. After searching for the answer I found that I need to restart the server.

Restarting the server

There are 3 methods to restart the server via command prompt and via Contabo dashboard. If you can access to console, I highly recommend restarting it from there.

1. Restarting server via Telnet using command prompt

Login as root via Telnet connection (using Putty) type sudo reboot and press enter key or sudo shutdown -r and press enter key.

reboot server
reboot server

2. Restarting server via VNC Client using command prompt

Reboot server using VNC Client such as Real VNC Viewer is the same as using Telnet but this connection is less secure because the connection is not encrypted.

VNC client
VNC client

3. Restarting server via Contabo Dashboard

If you cannot access to command prompt, you can still access it via the Contabo dashboard, but this is not recommended because it’s like a hard reset. If doing this many times your file system can get corrupted.

Error establishing a database connection2
Error establishing a database connection

1 week later I found that the Cron schedule causing this problem, at the moment I disable the Cron job from WP config. Since then I never experienced the same problem again.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *