观察MySQL进程状态-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
观察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
  State: 
  State: starting
  State: 
  State: starting
  State: 
  State: starting
  State: 
  State: starting
  State: 
  State: starting
  State: 
  State: starting
  State: 
  State: starting

3、对mysql.log按行进行排序、去重、计数
[root@mysql5 ~]# sort mysql.log |uniq -c
     24   State: 
     24   State: starting

4、根据state的信息,对数据库进行分析

网页题目:观察MySQL进程状态
文章来源:http://scgulin.cn/article/phdido.html