I was wondering if there Is away to automatically reboot server if the database went unresponsive?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Hello, @cameron1
You can create a simple bash script to check if MySQL is running and if not to restart it.
Run this script every 5 minutes using a cron job like this one:
Hope that this helps! Regards, Alex
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. <pre> /etc/init.d/mysql status || /etc/init.d/mysql start </pre>