Answers for "killmall process list mysql"

SQL
3

kill mysql processlist in whose time more than 200

mysql> select group_concat(concat('KILL ',id,';')) from 
information_schema.processlist where user='root' and time > 500;

mysql> source /tmp/a.txt;
Posted by: Guest on December-08-2020
1

bulk kill mysql processlist

SELECT CONCAT('KILL ',id,';') AS IDs
FROM information_schema.processlist 
WHERE TIME >10
AND command = "sleep"
Posted by: Guest on December-14-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language