Massiv dræbning sparer tid. Gør det i selve MySQL:
Kør disse kommandoer
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; ---------redigering------------ hvis du ikke vil gemme i en fil, gem i en variabel
Kør blot i din kommandoprompt
> 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")