2009-10-06

List of MySQL grants

The command line shows list of all grants on all databases, including root@locahosts. It also shows encrypted passwords as they exists in mysql.user table.

mysql -Bse "SELECT CONCAT('SHOW GRANTS FOR \'', user ,'\'@\'', host, '\';') FROM mysql.user" | mysql -Bs | sed 's/$/;/g'

No comments: