代码改变世界

【MySQL】MySQL批量KILL线程

  abce  阅读(589)  评论(0编辑  收藏  举报

1.使用pt-kill工具

1
pt-kill --user=root --password=123456 -hlocalhost --no-version-check --match-command Query --match-state "Sending data" --victims all --interval 2 --print --kill

  

2.SQL拼接

1
select concat('KILL ',id,';') from information_schema.processlist where Command='Query' and STATE='Sending data';

  

努力加载评论中...
点击右上角即可分享
微信分享提示