Auto Restart MySQL if Crashed

This bash script is used to auto restart MySQL or MariaDB database if it crash/stop for any reason.

Create file

Add

In the code, replace YOUR_ROOT_PW_HERE with your actual root password. If you are not using “root”, replace root with whatever username you use.

Make it executable

Create cronjob to run the script every 5 minutes.

Add

See MySQL

Leave a Reply

Your email address will not be published. Required fields are marked *