Skip to content

Instantly share code, notes, and snippets.

@ei-grad
Created September 1, 2016 20:08
Show Gist options
  • Save ei-grad/1a4cfa736a431150d6ccbacbe132617c to your computer and use it in GitHub Desktop.
Save ei-grad/1a4cfa736a431150d6ccbacbe132617c to your computer and use it in GitHub Desktop.
Show mysql grants
mysql -B -N -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM user ORDER BY user, host" mysql | mysql | grep -v 'Grants for'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment