This should never happen, but it does and so I’m going to tell you one way that I kill stale processes on my MySQL database server:
cat longprocesses.txt | awk ‘{print “kill “$1″;”}’
I run the show full processlist command on MySQL and then copy the list of stale processes to a file that I have named longprocesses.txt. Once that is done I have several lines of code that look like this:
kill 12345;
kill 93479;
….
I then copy this into MySQL or SequelPro and run the kill commands. This is somewhat tedious so I’m looking for a faster way to do this, any ideas, just post a comment. Thanks.