Advertisement
vicendominguez

massive-kill for mysql sleep connections

Oct 1st, 2013
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.30 KB | None | 0 0
  1. #This is a bullshit but... i will kill all the sleep connections which sleeping time starting with 8
  2.  
  3. for a in `echo "show processlist" |mysql --user=root --password=tete coredb |egrep 'Sleep[[:space:]]+8[[:digit:]]+' |awk '{ print $1 }'`; do echo "KILL $a" | mysql --user=root --password=tete coredb; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement