mysql show processlist info null_关于查询mysql processlist的建议
查詢mysql進程,因為數據庫的sleep連接很多(一般都會在幾千個左右),不建議直接show processlist或者show full
Processlist
盡量去用select查詢
正在running的線程
Select?count(*)from information_schema.processlist where info is not null;
Mysql的全部線程
Select?count(*)from information_schema.processlist;
查詢當前running sql執行時間最長的10條
Select * frominformation_schema.processlist where info is not null order by time desc limit10 ;
查詢執行sql的ip 的連接數量
select left(host,instr(host,‘:‘)-1) asip,count(*) as num from?information_schema.processlist group by ip order by num desc;
查詢執行sql的user的連接數量
select user,count(*) as num from? information_schema.processlist group by userorder by num desc;
查詢執行sql語句的數量
select count(*) as num,info from? information_schema.processlist where info isnot null group by info order by num;
查詢mysql服務器最大連接數、當前數據庫連接數和running數show global variables like ‘max_connections‘;
show global status like ‘Threads%‘;
查詢用戶最大連接數
show grants for ‘mysql_bi‘;
slave錯誤問題,需要確認數據不一致原因
adm和click庫可以直接跳過1個錯誤
一般處理的方式包括
殺掉慢查詢進程,可以針對用戶,執行時間去操作
select concat(‘KILL ‘,id,‘;‘) frominformation_schema.processlist where user=‘用戶名稱‘ and time>100into outfile ‘/tmp/aa.txt‘;
source/tmp/aa.txt
本文出自 “云淡風輕” 博客,謝絕轉載!
原文:http://liuminkun.blog.51cto.com/10171900/1685492
總結
以上是生活随笔為你收集整理的mysql show processlist info null_关于查询mysql processlist的建议的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2017微信网名男英文
- 下一篇: java修改 nsf中的数据_最新NSF