Auto-restart mysql when it dies
Posted
by
Los Frijoles
on Super User
See other posts from Super User
or by Los Frijoles
Published on 2013-06-23T23:55:21Z
Indexed on
2013/06/24
16:25 UTC
Read the original article
Hit count: 170
I have a rackspace server that I have been renting to run my personal projects upon. Since I am cheap, it has 256Mb of RAM and honestly can't handle alot. Every once in a while, when there is a sharp uptick in traffic, the server decides to start killing processes and it seems that mysqld is a popular one for it to kill. I try to visit my site and am greeted with the message that there was an error establishing the database connection. Inspection of the logs reveals that mysqld was killed due to lack of memory.
Since I am still as poor as I was yesterday and don't want to upgrade my rackspace VM's RAM, is there a way I can tell it to automagically restart mysqld when it dies?
I have a thought to use something like crontab, but alas, I don't know exactly what to do there either. I guess I am product of the "Linux on your desktop" generation since I can do most things on my desktop and laptop (which run Linux almost exclusively), but still lack a lot of server administration skills for Linux.
The server runs CentOS 6.3
© Super User or respective owner