mysql一键解锁表

查看是否有锁表

mysql> show open tables where in_use>0;

 

查看详细信息

mysql> show processlist;

 

一键解锁

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)

 

select concat('KILL ',id,';') from information_schema.processlist where user='root' into outfile '/tmp/a.txt';
source /tmp/a.txt;

posted @ 2018-06-01 09:39  你好!2022  阅读(1117)  评论(0编辑  收藏  举报