select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by ip;
转载于:https://www.cnblogs.com/ClassNotFoundException/p/5983403.html
本文介绍了一种使用MySQL的information_schema.processlist表来统计不同主机连接数的SQL查询技巧,通过使用SUBSTRING_INDEX函数来分离IP地址。
select SUBSTRING_INDEX(host,':',1) as ip , count(*) from information_schema.processlist group by ip;
转载于:https://www.cnblogs.com/ClassNotFoundException/p/5983403.html
5万+
2460

被折叠的 条评论
为什么被折叠?