龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 数据库类 > MySQL 技术 >

mysql批量kill locked进度方法

时间:2011-03-14 23:24来源:未知 作者:admin 点击:
分享到:
mysql教程 select concat('kill ',id,';') from information_schema.processlist where user='root'; +------------------------+ | concat('kill ',id,';') +------------------------+ | kill 3101; | kill 2946; +------------------------+ 2 rows in s

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全选删除就可以了。

精彩图集

赞助商链接