MySQL 批量殺mysql執行緒

weixin_34162629發表於2015-06-15
mysql> SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='root';
+------------------------+
| concat('KILL ',id,';') |
+------------------------+
| KILL 21107;            |
+------------------------+
1 row in set (0.01 sec)

mysql> SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='root' INTO OUTFILE '/tmp/killid.txt';
Query OK, 1 row affected (0.01 sec)

mysql> source /tmp/killid.txt;

  

相關文章