Tag Archives: kill

Mysql Mass Kill

This method I use to do mass kill on mysql process. After run “show processlist” and notice something.

mysql> select concat('KILL ',id,';') from information_schema.processlist
 where Host like '%oss%' and time > 200 into outfile '/tmp/lock.txt';
mysql> source /tmp/lock.txt;

done.. all the process where host like oss and time more than 200.

References:
mysqlperformanceblog, stackoverflow
tested  on centos 6.5 mysql 5.5

Advertisements