How do I kill all the processes in Mysql “show processlist”?

后端 未结 23 1922
温柔的废话
温柔的废话 2020-12-04 04:49

Because I see a lot of processes there, and the \"time\" column shows big values for all of them.

23条回答
  •  爱一瞬间的悲伤
    2020-12-04 05:34

    KILL ALL SELECT QUERIES

    select concat('KILL ',id,';') 
    from information_schema.processlist 
    where user='root' 
      and INFO like 'SELECT%' into outfile '/tmp/a.txt'; 
    source /tmp/a.txt;
    

提交回复
热议问题