Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prashanth5429/60c34b8c83927e7dc85abc8ff9b24d91 to your computer and use it in GitHub Desktop.
Save prashanth5429/60c34b8c83927e7dc85abc8ff9b24d91 to your computer and use it in GitHub Desktop.
Script to kill all MySQL processes for database user
#!/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