执行命令:show processlist ;
显示的数据里有个id字段,就是sessionid,
执行 kill id就可.
查询出所有需要Killd的Id;
select concat('KILL ',id,';') from information_schema.processlist where user='root';
本文介绍如何使用SQL命令查询并批量终止MySQL中特定用户的进程。通过执行特定命令展示如何找到需要终止的进程ID,并提供了一个实用的SQL脚本来批量执行终止操作。
执行命令:show processlist ;
显示的数据里有个id字段,就是sessionid,
执行 kill id就可.
查询出所有需要Killd的Id;
select concat('KILL ',id,';') from information_schema.processlist where user='root';
4782
923

被折叠的 条评论
为什么被折叠?