MySQL Forums
Forum List  »  Install & Repo

install instructions say to run *two* password-setting commands -- error?
Posted by: Bennett Haselton
Date: September 12, 2009 12:28AM

When I install mysql and start the service, the output includes this:

>>>
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h sls-ce12p12.dca2.superbservers.com password 'new-password'
>>>

However, when I try running BOTH of those commands (as the instructions say), the first one works and the second one gives an error (I have replaced my password below with 'america'; I wouldn't really use something that insecure as my real password) :

>>>
[root@sls-ce12p12 ~]# /usr/bin/mysqladmin -u root password 'america'
[root@sls-ce12p12 ~]# /usr/bin/mysqladmin -u root -h sls-ce12p12.dca2.superbservers.com password 'america'
/usr/bin/mysqladmin: connect to server at 'sls-ce12p12.dca2.superbservers.com' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
>>>

Knowing about what these commands actually do, it's clear why the second command fails. When you run the first command, there's no password set for root, so you can run admin commands as 'root' with no authentication, including setting the password for root. But by the time you run the second command, the password for root has been set, so you can no longer do anything as 'root' without first authenticating yourself.

So it seems like when the instructions say:
>>>
To do so, start the server, then issue the following commands:
>>>

that's an error in the instructions, because you're really only supposed to issue ONE of those two commands (since, for a locally installed database, they do the same thing), and once you've issued one of the commands, the other one won't work. Should that be changed? Or am I missing something?

Options: ReplyQuote


Subject
Written By
Posted
install instructions say to run *two* password-setting commands -- error?
September 12, 2009 12:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.