Question
MySQL drops out every few days?
So I have followed the tutorial to Install Wordpress, Nginx, PHP, and Varnish on Ubuntu 12.04.
The process was smooth and easily installed, so no problems there.
The issue is every few days the MySQL connect drops out and when I run the command:
$ sudo service mysql start
I get a the following message:
$ start: Job failed to start
The other issues is when it first happened, I looked into setting up a script to run in cron every 5 minutes.
# CHECK DATABASE STATUS
# launch-mysql.sh
ps auxw | grep mysql | grep -v grep > /dev/null
if [ $? != 0 ]
then
sudo service mysql start > /dev/null
fi
Then added this to $ cron -e
*/5 * * * * ~/launch-mysql.sh
But that is not working either, any thoughts or help would be greatly appreciated.
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.
×
I am getting the same problem! My Server Mysql stop working few times a day
same here :) fails after a few days providing the “Error establishing a database connection”
@talaviram MySQL is most likely crashing because it’s running out of memory. You can add swap to your droplet which should help with that:
If MySQL still crashes with a swapfile, you might have to upgrade your droplet to a plan with more RAM.