mysql主从状态检测:
echo "show slave status\G;"|mysql -uroot -pyanghui|grep Running|awk -F: ‘{print $2}‘|wc -c
MySQL运行状态检测:
echo "show processlist\G;"|mysql -uroot -pyanghui|grep -i host:|grep [0-9]|sed ‘s/Host://g‘
本文出自 “boyhack” 博客,请务必保留此出处http://461205160.blog.51cto.com/274918/1754652
原文地址:http://461205160.blog.51cto.com/274918/1754652