Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. 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

1 Answer 1

Give this a try in an elevated command prompt:

1: net stop mysql

2: mysqld_safe --skip-grant-tables &

3: mysql -u root

Output will look like this:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.5.13

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

4: Here you will reset your root password:

mysql> USE mysql;
mysql> UPDATE USER SET password=PASSWORD("NEW-ROOT-PASSWORD") WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

5: mysqladmin shutdown

6: Now you can start MySQL and test it:

net start mysql
mysql -u root -p
share|improve this answer
    
Where do I type these commands in? (I'm on windows) –  tnw Jun 16 '11 at 21:30
    
are you sure these commands are for windows? Both the commands you listed in #1 and #2 give me "service name is invalid" and "not recognized as an internal or external command", respectively. –  tnw Jun 17 '11 at 13:56
    
@Tory- Yes, this is for Windows. You can find out more info about running MySQL as a service here dev.mysql.com/doc/refman/5.0/en/windows-start-service.html –  chrsblck Jun 17 '11 at 16:28

Your Answer

 
discard

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.