Created
January 6, 2014 15:46
-
-
Save v0112358/8284720 to your computer and use it in GitHub Desktop.
Kill all mysql sleeping process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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