1

I've just installed WAMP and tried to change root password. The cmd shows the below error. How to fix?

Command:

C:\wamp\bin\mysql\mysql5.5.24\bin>mysqladmin -uroot PASSWORD root

Error:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
2
  • Did you already have a password or was it blank when setting up?
    – random
    Sep 8, 2012 at 13:58
  • I think it's blank because I've just installed it Sep 8, 2012 at 14:07

2 Answers 2

2
C:\wamp\bin\mysql\mysql5.5.24\bin\mysqladmin -u root password NEWPASSWORD

Manual:

c:\wamp\bin\mysql\mysql5.5.24\bin>mysqladmin --help
  -u, --user=name     User for login if not current user.
  password [new-password] Change old password to new-password in current format

Another solution:

1
  • @Emerald214 is it work for you yes/no? Accept it or post comment it doesn't work..
    – Peter
    Sep 9, 2012 at 18:08
0

sometimes this problem occurs because of different port numbers. mysql's default port number is 3306 but some settings of wamp server makes this 3307 or 3308 or something different. If you change default port number to 3306 for mysql from the settings (Right Click wampserver icon > Tools > Ports used by mysql > use a port other then ...) of wamp server it will give permission.

1
  • or you can use root@localhost:3308 (or port number which assigned currently to mysql, in my situation it was 3308)
    – ewroman
    Feb 9, 2020 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .