Skip to content

Instantly share code, notes, and snippets.

@shamil
Created July 19, 2012 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamil/3140656 to your computer and use it in GitHub Desktop.
Save shamil/3140656 to your computer and use it in GitHub Desktop.
mysql show grants snippet
# Show all grants
mysql --skip-column-names -e "SELECT user, host FROM mysql.user" | sed 's/\t/"@"/g; s/^/SHOW GRANTS FOR "/g; s/$/";/g;' | mysql --skip-column-names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment