日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

mysql show processlist info null_关于查询mysql processlist的建议

發布時間:2023/11/27 生活经验 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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的建议的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。