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

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 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.

1  
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

1 Answer 1

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

skip-grant-tables

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.