emerge –config =dev-db/mysql-5.5.28
GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; FLUSH PRIVILEGES;
mysql --batch --skip-column-names --execute="select concat('CREATE USER ''',user,'''@''',host,''' IDENTIFIED BY ''',Password,''';') from user where Password <> '''''';" mysql > mysql-users.sql mysql --batch --skip-column-names --execute="SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM user" mysql | mysql --batch --skip-column-names mysql | perl -p -e '$_ =~ s/$/;/; END { print "FLUSH PRIVILEGES;\n" }' > mysql-grants.sql use mysql; select concat('CREATE USER `',user,'`@`',host,'` IDENTIFIED BY `',Password,'`') from user;