
1、查看当前数据库的连接情况
show full processlist;shop processlist;
2、查看所有用户的总连接数
show variables like ‘%max_connections%‘;
3、查看每一个用户的最大连接数
show variables like ‘%max_user_connections%‘;
4、查看当前连接中各个用户的连接数
select USER , count(*) from information_schema.processlist group by USER;
5、查看当前连接中各个IP的连接数
select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by SUBSTRING_INDEX(host,':',1) ;
6、查看当前连接中连接时间最长的的连接
select host,user,time,state,info from information_schema.processlist order by time desc limit 10;
7、查询线上Mysql数据库的连接数配置
show variables like ‘%conn%‘;

扫描二维码(或长按图片识别)获取
更多精彩


如果您觉得好看,请点个“在看”↓↓↓
文章转载自IT民工2020,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





