Skip to content

Instantly share code, notes, and snippets.

@v0112358
Created January 6, 2014 15:46
Show Gist options
  • Save v0112358/8284720 to your computer and use it in GitHub Desktop.
Save v0112358/8284720 to your computer and use it in GitHub Desktop.
Kill all mysql sleeping process
<?php
$result = mysql_query("SHOW processlist");
while ($myrow = mysql_fetch_assoc($result)) {
if ($myrow['Command'] == "Sleep") {
mysql_query("KILL {$myrow['Id']}");
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment