kill mysql code example
Example 1: bulk kill mysql processlist
SELECT CONCAT('KILL ',id,';') AS IDs
FROM information_schema.processlist
WHERE TIME >10
AND command = "sleep"
Example 2: mysql kill
mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ')
FROM information_schema.processlist WHERE user <> 'system user';
Example 3: kill all mysql processes
sudo killall mysqld