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've somehow managed to completely lock myself out of MySQL on WAMP. It seems all privileges are denied for all users. The only way I can get into MySQL is via the command prompt but without entering a user. From there, I quite literally cannot do anything... all privileges are denied. I've tried updating the root password to no avail.

I've also tried completely uninstalling WAMP as well as MySQL. After uninstalling MySQL, I deleted the data directories inside them to get rid of all the info there. After re-installing WAMP, the problem persists.

Attempts to access PHPMyAdmin results in:

#1045 - Access denied for user 'root'@'localhost' (using password: NO) 

Can anyone help??

share|improve this question

closed as off-topic by Hyppy, dawud, 84104, masegaloeh, Ward Apr 18 '15 at 5:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – Hyppy, dawud, 84104, masegaloeh, Ward
If this question can be reworded to fit the rules in the help center, please edit the question.

It appears that the root user's password is not being provided for the login attempt. – Daemon of Chaos Jun 16 '11 at 22:00
@KayakJim Good work, that's exactly what my error message says. Have you ever used WAMP before? – tnw Jun 17 '11 at 15:10

Add the following line to your my.cnf or my.ini and restart the mysql server:


Then change the password in mysql.user table

update user set password = password('newpassword') where user = 'root'

Remove the skip line and restart the server. You will be able to login with the new password.

share|improve this answer
Using the second command in MySQL gives me an error: No database selected. – tnw Jun 17 '11 at 13:51
Change the second command to be: update mysql.user set password = password('newpassword') where user = 'root' – Daemon of Chaos Jun 17 '11 at 15:14
@KayakJim @ghm1014 UPDATE command denied... – tnw Jun 17 '11 at 15:27
After MySQL is restarted with the skip-grant-tables option, are you able to access the database via PHPMyAdmin? If so, navigate to the mysql database, select the user table, and edit the root user record to reset the password. Be sure to select PASSWORD for the Function. – Daemon of Chaos Jun 17 '11 at 15:33
@KayakJim No, now I simply get 404 not found for all my localhost pages, including phpMyAdmin – tnw Jun 17 '11 at 15:45

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