观察MySQL进展状态
发布时间:2022-03-31 23:35:53 所属栏目:MySql教程 来源:互联网
导读:观察MySQL进展状态: 1、测试脚本 [root@mysql5 ~]# cat proce.sh while true do mysql -uroot -pmysql -e show processlist G|grep State /root/mysql.log sleep 1 done 2、tail -f [root@mysql5 ~]# tail -f mysql.log State: State: starting State: S
观察MySQL进展状态: 1、测试脚本 [root@mysql5 ~]# cat proce.sh while true do mysql -uroot -pmysql -e 'show processlist G'|grep State >> /root/mysql.log sleep 1 done 2、tail -f [root@mysql5 ~]# tail -f mysql.log State: State: starting State: State: starting 3、对mysql.log按行进行排序、去重、计数 [root@mysql5 ~]# sort mysql.log |uniq -c 24 State: 24 State: starting 4、根据state的信息,对数据库进行分析。 (编辑:PHP编程网 - 黄冈站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |