Created
March 17, 2015 20:52
-
-
Save nikolazic/b0977c3b598b26fb86c8 to your computer and use it in GitHub Desktop.
Get all users' grants
This file contains hidden or 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
sudo mysql --silent --skip-column-names --execute "select concat('\'',User,'\'@\'',Host,'\'') as User from mysql.user" | sort | \ | |
while read u | |
do echo "-- $u"; sudo mysql --silent --skip-column-names --execute "show grants for $u" | sed 's/$/;/' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment