批量杀死MySQL连接的四种方法详解
方法一 通过information_schema.processlist表中的连接信息生成需要处理掉的MySQL连接的语句临时文件,然后执行临时文件中生成的指令。 代码如下: mysql> select concat(‘KILL ‘,id,’;’) from information_schema.processlist where user=’root’; +————————+ | concat(‘KILL ‘,id,’;’) | +————————+ | KILL 3101; | | KILL 2946; | +————————+ 2 r
下载地址
用户评论