Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed mySQL, I booted it up.

Now I'm trying to set the password in mysqladmin with this :

mysqladmin -u root -hec2-50-17-36-82.compute-1.amazonaws.com password 'my_password'

This returns :

mysqladmin: connect to server at 'ec2-50-17-36-82.compute-1.amazonaws.com' failed
error: 'Access denied for user 'root'@'ip-10-127-34-29.ec2.internal' (using password: NO)'

But if I do this.. :

mysql -u root -hec2-50-17-36-82.compute-1.amazonaws.com

I can log right into the server, and it doesn't even ask for a password!

What's happening? What should I do from here?

share|improve this question
    
What is the output of mysql -u root -ppassword -h ec2-50-17-36-82.compute-3.amazonaws.com? –  quanta Nov 2 '11 at 15:01
add comment

2 Answers

up vote 1 down vote accepted

If you have never set the root password for MySQL server, the correct syntax is:

$ mysqladmin -u root password NEWPASSWORD
share|improve this answer
    
When I do this it just displays a list of all the mysqladmin commands. –  Trip Nov 2 '11 at 14:44
    
Please append the output to your original post. –  quanta Nov 2 '11 at 14:49
    
I tried your command but that's for setting a localhost. Mine is for a foreign host ec2-50-17-36-82.compute-3.amazonaws.com, and when I type : mysqladmin -u root -hec2-50-17-36-82.compute-3.amazonaws.com -p password ACTUALPASSWORD it says, error: 'Access denied for user 'root'@'ip-10-127-37-29.ec2.internal' (using password: NO)' –  Trip Nov 2 '11 at 14:55
    
Are you sure you haven't set root password? If so, remove the -p option to set it. If not and you don't remember, just reset by starting MySQL with skip-grant-tables option. –  quanta Nov 2 '11 at 15:00
    
Cool it looks like that got me to the next error. Thanks –  Trip Nov 2 '11 at 15:07
add comment

the -p switch on mysqladmin says you're trying to use a password, and that the password is password. It gets a little confusing because it seems your current password is password. Try this:

mysqladmin -u root -h your_mysql_server -p'password' password yournewpasswordhere 
share|improve this answer
    
I replaced my actual password with the word "password" for this example. In your example, which should actually be the word, password? –  Trip Nov 2 '11 at 14:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.