Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. 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 been using WAMP server for a while and I have several databases on the mysql server.

today I installed microsoft webmatrix and when I opened one of my sites on wamp I got a mysql error saying the connection has failed, and when I try to open the phpmyadmin it says access denied.

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

I guess it somehow changed the password for my user, so how can I reconnect to wamp's phpmyadmin and restore my old databases?

Currently I can connect to the server with the password ' ' (space) but my databases are gone.

EDIT: ok I changed the password back to '' (null) using an sql command

SET PASSWORD FOR 'user'@'hostname' = PASSWORD('passwordhere');

is it possible to restore the old dbs?

share|improve this question

migrated from Dec 6 '12 at 20:37

This question came from our site for professional and enthusiast programmers.

Here is the only thing I can advise for now:

Open a DOS Window and run the following

C:\> dir mysql.user /s

If you see two mysql.user files, then you may have two DB setups.

You would just have to point datadir in my.cnf back to the old setup.

Please find out and let me know ...

share|improve this answer
thank's I just manually restored it all – Dotan Reis Dec 9 '12 at 10:34

If you didn't remove or modify the default accounts, you may be inadvertently connecting with one of those instead of the account you think you're connecting with.

Examples below are from a server that definitely has more databases than the two shown, but connecting using an unexpected username which matches one of the default account, which has an empty username and password.

$ mysql --user=bogus --password='' # this is an empty string, not a space

mysql> show grants;
| Grants for @localhost                |
| GRANT USAGE ON *.* TO ''@'localhost' |
1 row in set (0.00 sec)

mysql> show databases;
| Database           |
| information_schema |
| test               |
2 rows in set (0.00 sec)


If this is what you're seeing, then this could be what's happening. Your data may all be intact but you're not signing in as the user that you think you are -- because you're matching that anonymous account, which has very few permissions.

The SHOW GRANTS statement will tell you who you are really connected as.

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.