After a fresh install of mysql the ebuild says after the command shown in the summary: ... PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, issue the following commands to start the server and change the applicable passwords: /etc/init.d/mysql start /usr/bin/mysqladmin -u root -h n22 password 'new-password' /usr/bin/mysqladmin -u root password 'new-password' ... but the second command is wrong. See here the reason: ... n22 /var/log/portage # /etc/init.d/mysql start * Starting mysqld... [ ok ] n22 /var/log/portage # /usr/bin/mysqladmin -u root -h n22 password mypwd n22 /var/log/portage # /usr/bin/mysqladmin -u root password mypassword /usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: NO)' n22 /var/log/portage # /usr/bin/mysqladmin -u root password mypassword -p Enter password: ... The second command does need the parameter '-p' because at the time the command is called a password was set immediately before. Reproducible: Always Steps to Reproduce: 1. 2. 3.
the second command is NOT wrong. it only depends on the configuration of your system (namely is mysqladmin connecting to the mysql instance using the loopback interface, or the non-localhost address?) we picked the route that would have the fewest bug reports like this.