mysql 批量kill

xiaoxiao2021-02-28  12

mysql> select concat('KILL ',id,';') from information_schema.processlist where user='root'; +------------------------+ | concat('KILL ',id,';') | +------------------------+ | KILL 3101; | | KILL 2946; | +------------------------+ 2 rows in set (0.00 sec) mysql> select concat('KILL ',id,';') from information_schema.processlist where user='root' into outfile '/tmp/a.txt'; Query OK, 2 rows affected (0.00 sec) mysql> source /tmp/a.txt; Query OK, 0 rows affected (0.00 sec)

参考Mass killing of MySQL Connections

查找可导出路径

show variables like '%secure%';查看 secure-file-priv 当前的值是什么

参考

转载请注明原文地址: https://www.6miu.com/read-2400319.html

最新回复(0)