首页 > 数据库技术 > 详细

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

时间:2015-08-13 20:32:44      阅读:752      评论:0      收藏:0      [点我收藏+]

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;  


本文出自 “云淡风轻” 博客,谢绝转载!

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

原文:http://liuminkun.blog.51cto.com/10171900/1684233

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!