Kill tous les sleeps de plus de 10s :
for requete in $(mysql INFORMATION_SCHEMA -B -e'select id from PROCESSLIST where Command like "Sleep" and TIME >= "10"'| grep -v id); do /usr/bin/mysqladmin kill $requete ; done
Kill tous les selects de plus de 10s :
for requete in $(mysql INFORMATION_SCHEMA -B -e'select id from PROCESSLIST where INFO like "select%" and TIME >= "10"'| grep -v id); do /usr/bin/mysqladmin kill $requete ; done
Voir les requêtes en cours :
mysqladmin pro
ou
mysql -e"show processlist"
Voir les requêtes en cours en entier :
mysql -e"show full processlist"