您的位置:首页 > 数据库 > MySQL

MySQL 杀死指定用户的全部进程

2015-08-13 09:40 666 查看
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='mysql_lama' into outfile '/tmp/aa7.txt';

select concat('KILL ',id,';') from information_schema.processlist where info is not null and user<>'root' and user<>'system user' and time>1 into outfile '/tmp/a132.txt';

mysql>source /tmp/a.txt;

本文出自 “云淡风轻” 博客,谢绝转载!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: