“Mysql Kill” Respostas de código

Bulk Kill MySQL ProcessList

SELECT CONCAT('KILL ',id,';') AS IDs
FROM information_schema.processlist 
WHERE TIME >10
AND command = "sleep"
Shiny Skipper

Mysql Kill

mysql> SELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ') 
 
FROM information_schema.processlist WHERE user <> 'system user';
Lucky Ladybird

Mysql Kill

-- 查询执行时间超过2分钟的线程,然后拼接成 kill 语句
select concat('kill ', id, ';')
from information_schema.processlist
where command != 'Sleep'
and time > 2*60
order by time desc
Exuberant Echidna

Respostas semelhantes a “Mysql Kill”

Perguntas semelhantes a “Mysql Kill”

Mais respostas relacionadas para “Mysql Kill” em Sql

Procure respostas de código populares por idioma

Procurar outros idiomas de código