mysql批量kill locked进度方法

select concat('kill ',id,';') from information_schema.processlist where user='root';
+------------------------+
| concat('kill ',id,';')
+------------------------+
| kill 3101;
| kill 2946;
+------------------------+
2 rows in set (0.00 sec)

mysql> select concat('kill ',id,';') from information_schema.processlist where user='root' into outfile '/tmp/a.txt';
query ok, 2 rows affected (0.00 sec)

mysql> source /tmp/a.txt;
query ok, 0 rows affected (0.00 sec)

方法二,直接进入mysql找到information_schema的processlist全选删除就可以了。
方法三,进入mysql,show processlist; kill id

发表评论

电子邮件地址不会被公开。