低于2G的小内存的VPS,流量过大Mysql容易被杀 #!/bin/bash pgrep -x mysqld &> /dev/null if [ $? -ne 0 ] then echo “At time: `date +%Y%m%d-%H:%M:%S` MySQL is stop .”>> restartmysql.log systemctl restart mariadb.service else echo “At time: `date +%Y%m%d-%H:%M:%S` MySQL server is running .”>> restartmysql.log fi 复制代码 –restart=unless-stopped 复制代码