SELECT client_ip, count(client_ip) AS client_num FROM ( SELECT substring_index(HOST, ':', 1) AS client_ip FROM information_schema. PROCESSLIST ) AS connect_info GROUPBY client_ip ORDERBY client_num DESC;
查看正在执行的线程,并按 Time 倒排序,看看有没有执行时间特别长的线程
1 2 3 4 5 6 7 8
SELECT * FROM information_schema. PROCESSLIST WHERE Command !='Sleep' ORDERBY TimeDESC;