mysql 挂了之后,自动重启

 2022-12-12
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
site=http://localhost/m1.php

stat=$(curl -s $site);

if [ $stat == "err" ]; then
    systemctl restart mysqld 2>>/alidata/log/mysql_err_log.log

fi
exit 0