Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 wamp in my windows 7 machine. While setting the root password in mysql , I got following error :

C:\wamp\bin\mysql\mysql5.1.36\bin>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I am installing mysql first time , so I have not set the password before. I tried to solve the problem using the link. I know this link is for linux but I followed the first step and tried to stop mysql. It showed following error :

C:\wamp\bin\mysql\mysql5.1.36\bin>mysql stop
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

As you can see, it is not allowing me to use any command. I am running the cmd as admin. Can anybody help me to solve this problem please. Thanks in advance.

share|improve this question
Can you use the phpmyadmin that is included with wamp? – Kenny Rasschaert Nov 20 '10 at 21:27
up vote 0 down vote accepted

WAMPserver installs MySQL with a root user without a password.
Just type mysql -u root -p and hit enter when asked for password.
Then you can set a new password by typing mysqladmin -u root password NEWPASSWORD.

share|improve this answer
Thanks problem solved – user58859 Nov 21 '10 at 9:16

Start phpMyAdmin from the wampserver icon

Click on Privileges

You should then see a User Overview page

Click on the Edit Privileges icon to the right of the user you want edit.

You should get a page with a page with a Change Password panel

Enter a password and Re-type then click Go.

you should then be able to use

mysql -u root -p password
share|improve this answer

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.