萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> mysql教程 >> mysql批量kill locked進度方法

mysql批量kill locked進度方法

mysql教程> 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全選刪除就可以了。

copyright © 萬盛學電腦網 all rights reserved