批量kill mysql线程方法

1、查看对应的线程信息:mysql> select * from information_schema.processlist where user='your_user' and command='sleep';

2、将大量kill线程语句放入文件用于后续直接执行:

  mysql -hdbaas.mysql.minirds.env28.intranet.com -uyour_user -pyour_password -P3xxx -e "select concat('KILL ',id,';') from information_schema.processlist where user='your_user' and command='sleep';" > /tmp/kill.sql

3、直接执行: mysql> source /tmp/kill.sql

posted on 2019-11-20 15:40  凌乱的运维  阅读(897)  评论(0编辑  收藏  举报

导航