Skip to content

Instantly share code, notes, and snippets.

@deathcult
Last active October 11, 2016 17:53
Show Gist options
  • Select an option

  • Save deathcult/7655557 to your computer and use it in GitHub Desktop.

Select an option

Save deathcult/7655557 to your computer and use it in GitHub Desktop.
kill mysql sleep process
#!/bin/sh
## MySQL 5.1.61
## sleep时间大于等于10秒,kill掉:
mysqladmin -u* -p* processlist |grep -i sleep |awk '{if($12>=10) print $2}' |xargs -n1 mysqladmin -u* -p* kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment