Skip to content

Instantly share code, notes, and snippets.

@ashokarun
Created October 1, 2017 16:56
Show Gist options
  • Save ashokarun/fef83b5949057187c1723597247155b6 to your computer and use it in GitHub Desktop.
Save ashokarun/fef83b5949057187c1723597247155b6 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