标签:mysql
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