show processlist에서 ip를 확인하려고 할 때, 수백 또는 수천개의 로우가 검색되면 일일이 확인하기가 어렵다.

이 때 ip를 그룹핑해서 확인하는 방법이다.

select user,substring_index(host,':',1) hosts, count(*)
from information_schema.processlist
where user not in ('system user') group by hosts;

 

Print Friendly and PDF Posted by JJ*
: