SELECT CONCAT( 'kill ', id, ';' )
FROM information_schema.processlist
WHERE TIME >30

结果:

杀掉所有慢查询进程_mysql