Mysql查看连接数(连接总数、活跃数、最大并发数)

精品原文
https://blog.csdn.net/ranran0224/article/details/120569354

临时改配置

show variables like '%max_connection%';
show variables like '%cache_size%';
set global max_connections=2000;
set global wait_timeout=60;
set global interactive_timeout=60;

调查客户端ip,杀死session

show status like 'Threads%';
SELECT substring_index(host, ':',1) AS host_name,state,count(*) FROM information_schema.processlist GROUP BY state,host_name;
show full  processlist;
select CONCAT('kill ',id,';') from information_schema.processlist

查看锁表

show OPEN TABLES where In_use > 0;
posted @ 2022-06-09 09:50  vaen  阅读(167)  评论(0)    收藏  举报