Answers for "kill all process in 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
0

kill all mysql processes

sudo killall mysqld
Posted by: Guest on February-22-2021
1

mysql kill

mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') 
 
FROM information_schema.processlist WHERE user <> 'system user';
Posted by: Guest on January-29-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language