Mysql查看用户连接数配置及每个IP的请求情况

1、查看当前数据库的连接情况

    show full processlist;

    show 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 ip;

6、查看当前连接中连接时间最长的的连接

 select host,user,time,state,info from information_schema.processlist order by time desc limit 10;

7、查询线上Mysql数据库的连接数配置

show variables like '%conn%';

posted @ 2020-06-15 18:06  xuzhujack  阅读(6416)  评论(0编辑  收藏  举报
;