Killing Long-Running MySQL Processes

Killing long running MySQL queries is easy. There is KILL command

where PROCESS_ID is an ID from SHOW PROCESSLIST command. I have created small PHP script to kill all long running processes using RegExp.

You can checkout it from my Github:

Just change $host, $user and $password to access your MySQL server, and add regexp that matches your query.

Change $minExecutionTimeToKill to minimum number of seconds that query should be running before killing.

To run simply execute:

$ php ./kill.php

View on Github


  1. But let’s not forget that their primary goal is to gain capital. Or, let different app developers that have the provides on their App Store listings exclude classes of adverts from their app. Just as the company's attempts to protect children are undermined by it now selling playing apps to them, so the 메리트카지노 agency's claim to be for creative people retains taking a dent. For instance, Apple's famously successful "Shot on iPhone" marketing campaign ripped off the photographers — until criticism, including from AppleInsider — made it cease.


Post a Comment

Popular posts from this blog

Starting MongoDB Replica Set on Docker