1.使用pt-kill工具
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拼接
select concat('KILL ',id,';') from information_schema.processlist where Command='Query' and STATE='Sending data';