Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I installed mySQL, I booted it up.

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

mysqladmin -u root password 'my_password'

This returns :

mysqladmin: connect to server at '' 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

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 – quanta Nov 2 '11 at 15:01
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, and when I type : mysqladmin -u root -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

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

Your Answer


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.