User Tools

Site Tools


mysql_queries

Killing a handful of mysql queries

for i in $(mysql -e 'show processlist;' | awk '/database/ && /SELECT/' | awk '$6 > 10 {print $1}'); do echo "Killing query number: " $i; echo "KILL " "$i" ";"| mysql; done
This one-liner kills the queries obtained through the following information:

Database: database
Query : SELECT
Time : 10 seconds +


Change the information above in the one-liner to tailor to your needs

mysql_queries.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki