Forked from ashokarun/gist:fef83b5949057187c1723597247155b6
Created
November 7, 2017 11:22
-
-
Save prashanth5429/60c34b8c83927e7dc85abc8ff9b24d91 to your computer and use it in GitHub Desktop.
Script to kill all MySQL processes for database user
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 | |
#Author : Arunlal A | |
#Website: https://www.crybit.com | |
echo -n "Enter databse user name: " | |
read THEUSER | |
skill -9 -u $THEUSER ; for i in `mysqladmin processlist | grep $THEUSER | awk '{print $2}'` ; do mysqladmin kill $i ; done ; echo "$THEUSER has been killed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment