全部博文(2759)
分类: Mysql/postgreSQL
2014-08-28 21:50:36
mysql> SELECT concat('KILL ',id,';') FROM information_schema.processlist WHERE user='root' INTO OUTFILE '/tmp/kill_id.txt';
Query OK, 2 rows affected (0.00 sec)
查看临时文件的内容
[mysql@node2 ~]$ more /tmp/kill_id.txt
KILL 1;
KILL 4;
批量删除会话
mysql> source /tmp/kill_id.txt;
-- The End --