0

Is it possible to kill all mySQL processes at once, except for one process id?

Jason
  • 15,017
  • 23
  • 85
  • 116
d-_-b
  • 21,536
  • 40
  • 150
  • 256

1 Answers1

4

You can use the information_schema table for that, its a bit of a hassle but it works ;)

mysql> select concat('KILL ',id,';') from information_schema.processlist
where id != '1234' into outfile '/tmp/foo.txt';

mysql> source /tmp/foo.txt;
Johan
  • 1,958
  • 11
  • 20