时间:2021-07-01 10:21:17 帮助过:24人阅读
#!/bin/bash /usr/bin/nmap localhost |grep 3306 if [ $? -eq 0 ] then /usr/local/mysql/bin/mysql -uxxxxx -pxxxxxx --connect_timeout=5 -e "show databases;" if [ $? -ne 0 ] then /bin/photoshop/ target=_blank class=infotextkey>ps aux |grep mysql |grep -v grep | awk '{print $2}' | xargs kill -9 /usr/local/mysql/bin/mysqld_safe --user=mysql & > /dev/null fi else /usr/local/mysql/bin/mysqld_safe --user=mysql & > /dev/null fibitsCN.com
以上就是轻松接触一个检测MySQL状态的脚本的内容,更多相关内容请关注PHP中文网(www.gxlcms.com)!