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%';


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM