检测mysql是否在运行 #!/bin/bash pgrep -x mysqld &> /dev/null if [ $? -ne 0 ];then /etc/init.d/mysqld start fi