脚踏实地、勇往直前!
全部博文(1005)
分类: Mysql/postgreSQL
2014-08-25 10:23:16
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 --