监听mysql是否挂了,如果挂了就重启mysql
#!/bin/bash
pgrep -x mysqld &>
/dev/null
if
[ $? -
ne
0 ]
then
echo
"At time: `date` :MySQL is stop ."
>>
/var/log/mysql_messages
service mysql start
#echo "At time: `date` :MySQL server is stop."
else
echo
"MySQL server is running ."
fi
原文:http://www.cnblogs.com/ytfcz/p/4964940.html