For as long as it is only about a few of them, it is as simple as
looking at the SHOW PROCESSLIST
output for thread
identifiers to kill. They can be found in the first column called
Id
. These values can be passed to KILL
thread_id
command in MySQL. The problems appear
with more complex scenarios. What if one needs to terminate all
queries running longer than ten seconds? Doing copy&paste
repetitively could take a lot of time with twenty or so candidate
threads. This can be done much more efficiently.
INFORMATION_SCHEMA to the rescue!
Earlier today we showed “Anohter way to work with MySQL process list”.
That post presents how PROCESSLIST
table can be used
to retrieve any information about connected threads or running
queries.
In order to perform …
[Read more]