Skip to content

Instantly share code, notes, and snippets.

@mishudark
Created January 18, 2013 13:31
Show Gist options
  • Save mishudark/4564542 to your computer and use it in GitHub Desktop.
Save mishudark/4564542 to your computer and use it in GitHub Desktop.
TIME=10
for ID in $( mysql information_schema -e "SELECT ID FROM processlist WHERE INFO REGEXP '^[Ss][Ee][Ll][Ee][Cc][Tt]' AND TIME >= ${TIME};" )
do
echo -n "Killing thread ${ID}..."
mysqladmin kill ${ID}
echo " Done"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment