Windows Vista 64bits & MySQL: ERROR 1045 (28000): Access denied for user ‘root’@'localhost’
Today -at Kleer- we went through the experience of installing MySQL 5.1 for the first time in Vista 64bits. Far from being a pleasant installation, as we’re used to, this made us sweat bullets sweat.
After downloading the 64bit installer, install and configure, the setup wizard wouldn’t stop giving the error:
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost'
We tried many solutions but none worked. Except for the following:
1. Stop the service “MySQL” from “Control Panel-> Administrative Tools-> Services”
2. Go to “C:\Windows\System32″
3. Find the file cmd.exe, right click with SHIFT down and select “Run as administrator”
4. Run the following command:
mysqld - skip-grant-tables
5. Leave that window running
6. Open another terminal window, this time NOT as administrator: “Start-> Run-> cmd” ENTER
7. Run the following command:
mysql-u root mysql
8. Wala! We are inside. Run the following statement, changing a password mypass real you want setear:
UPDATE user SET Password = PASSWORD ('mypass') WHERE USER = 'root';
FLUSH PRIVILEGES;
9. Exit:
exit
10. Close the window
11. Close the window that was running as administrator
12. Open task manager and kill all processes named “mysqld” (there should be one, of another user “Administrator”)
13. Start the service from “Control Panel-> Administrative Tools-> Services”
14. Log in again, this time as we are used to:
mysql-u root-p
With this last step, you should be connected without problems. I hope this solution can serve someone and save some time.


Gracias a mi me ha funcionado; excelente explicación