Automatically reboot server

June 10, 2014 1.4k views
I was wondering if there Is away to automatically reboot server if the database went unresponsive?
1 Answer
Restart the whole machine? Or just the MySQL instance? I'm thinking it's the latter, in which case you can add a cronjob at your own desired interval which will periodically check if MySQL is running and start it if it is not.
/etc/init.d/mysql status || /etc/init.d/mysql start
Have another answer? Share your knowledge.