Database error message on wordpress based website.

Posted June 21, 2016 3.5k views

My server is a Ubuntu-Lamp 14.04 droplet named economas-droplet-ubuntu. I noticed that sometimes when I tried to access the website it will have a databased errror related message “Error establishing a database connection” I was fixing this issue by power cycling the droplet, but since yesterday this hasn’t worked at all.

Please let me know if you can guide me to find a solution to this problem since I have an important meeting tomorrow.

Thank you,

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
3 answers

This is not a digital ocean problem. I would contact a person with knowledge of systems administration.

by Jon Schwenn
WordPress is a popular and powerful CMS (content management system) platform. Its popularity can bring unwanted attention in the form of malicious traffic specially targeted at a WordPress site. There are many instances where a server that has not been protected or optimized could experience issues or errors after receiving a small amount of malicious traffic. This guide will show you how to protect WordPress from XML-RPC attacks on an Ubuntu 14.04 system.

Login to the server and check the following files for errors /var/log/mysql/error.log, /var/log/mysql.log and /var/log/mysql.err to find the root cause of the issue.

You can try running the following command to restart the mysql server manually
sudo service mysql restart, please note that might be a temporary fix as you need to find what causes the mysql server to stop.