On the internetz I found something that gives you ALL privileges for ALL users. In 1 line. Since it didn't work I rewrote it and post it here:
mysql -uUSERNAME -pPASSWORD -B -N -e "SELECT user, host FROM mysql.user" | sed 's,\t,"@",g;s,^,show grants for ",g;s,$,";,g;' | mysql -uUSERNAME -pPASSWORD -B -N | sed 's,$,;,g'
Copy and paste at your convenience, run directly from your bash shell command line. Leave/modify -u and / or -p as you wish. And for a bonus, here's how you get a list of all users@hosts:
mysql -uUSERNAME -pPASSWORD -e "select Host, User, Password from mysql.user"
That is all.
Geen opmerkingen:
Een reactie posten