mysql

Thu, 24 Nov 2011 01:26:41 +0100
mysql, perl

Show Grants:

mysql --skip-column-names -e "select distinct concat('show grants for''',user,'''@''',host,''';') as query from mysql.user" | \
mysql --skip-column-names | \
perl -ne 'next if m/(?:monit|replica|root|ronie)/; s/$/;/; print; END {print "flush privileges;\n" }'}}

Show Users:

select user,host from mysql.user;