mysql查看sql进程

1.查看数据库中所有sql进程

SELECT * FROM information_schema.PROCESSLIST
WHERE info IS NOT NULL
ORDER BY TIME desc,state,INFO;

2.根据条件组装kill xxx信息

SELECT CONCAT('kill ',id,';') AS KillSQL FROM information_schema.PROCESSLIST 
WHERE 1=1 
-- info LIKE '%from /*[Article_List]*/%' 
AND DB='b2b'
and time>10;

3.把查询结果复制粘贴出来,然后执行脚本。

你可能感兴趣的:(mysql)