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; doneThis 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