查看mysql连接等信息
查看*连接数设置
show variables like '%conn%';
查看当前数据库的连接情况
show processlist;
#只能列出当前100条
show full processlist;
#全部列出
查看当前连接中各个用户的连接数
select USER , count(*) from information_schema.processlist group by USER;
查看当前连接中各个IP的连接数
select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by ip;
查看当前连接中连接时间最长的的连接
select host,user,time,state,info from information_schema.processlist order by time desc limit 10;