1SELECT CONCAT('KILL ',id,';') AS IDs
2FROM information_schema.processlist
3WHERE TIME >10
4AND command = "sleep"
5
1mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ')
2
3FROM information_schema.processlist WHERE user <> 'system user';
4