Last active
March 3, 2017 14:27
-
-
Save nikhilw/2a64c1d1d7b6952b7b8cac0f6ed67df2 to your computer and use it in GitHub Desktop.
Kill all open connections to a mysql server
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
#! /bin/bash | |
mysql -u root -proot -e "select id from information_schema.processlist;" | grep -e [0-9] | while read in; do mysql -u root -proot -e "kill $in"; done | |
echo "verify" | |
mysql -u root -proot -e "select count(id )from information_schema.processlist;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment