批量处理mysql数据库大量sleep状态进程

先查询

SELECT CONCAT('KILL ', id, ';') AS kill_statement
FROM information_schema.processlist
WHERE command = 'Sleep' AND time > 50;

后复制 运行
1.png

然后把kill复制出来运行

此处评论已关闭