因为我在那里看到了很多进程,并且“时间”列显示了所有进程的大值。
大规模屠杀操作节省时间。在 MySql 本身中执行此操作:
运行这些命令
mysql> select concat('KILL ',id,';') from information_schema.processlist
where user='root' and time > 200 into outfile '/tmp/a.txt';
mysql> source /tmp/a.txt;
参考 http://www.mysqlperformanceblog.com/
---------edit------------
如果您不想存储在文件中,请存储在variable
只需在命令提示符下运行
> out1=$(mysql -B test -uroot -proot --disable-column-names -e "select concat('KILL ',id,';') from information_schema.processlist where user='root' and time > 200;")
> out2= $(mysql -B test -uroot -proot --disable-column-names -e "$out1")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)