How We Kill mysql sleep processes Like:
+------+-----------+-----------+------------------------+---------+------+----------------+-----------------------------------
Vishal's answer works well if you're running the command on the MySQL server, but it won't work if you're connecting to the server remotely or if you don't have permission to run SOURCE or SELECT ... INTO OUTFILE
(eg. Amazon's RDS). It's possible to rewrite it not to rely on those features though, and then it'll work anywhere:
mysql -h -u -p -e "SELECT CONCAT('KILL ',id,';') FROM information_schema.processlist WHERE Command = 'Sleep'" > sleep.txt
cat sleep.txt | xargs -I% mysql -h -u -p -e "%"