Error Number 1045.
Access denied for user 'root'@'localhost' (using password:NO)
I encountered this error during the time I'm setting up PHP, Apache, & MySQL. I get stocked with MySQL installation part because of that error you saw above. I seek various solution throughout the web but it seems many haven't tried this alternative solution that I kinda discovered.
If you're using Microsoft Windows 7 OS, then the steps below could be the solution to your MySQL Error Nr. 1045:
1) Uninstall MySQL5.X.X
Access the directory location where you've installed MySQL5.X.X (in time of uninstallation, some of the configuration settings are still left stored on the location where you've installed MySQL5.x.x even though you've uninstalled it). In my case, by default, It was installed in my Local Disk (C:)/Program Files [CLICK SCREENSHOT BELOW TO ENLARGE]
2) Inside (C:)/Program Files, look for "MySQL" folder. Delete it. [CLICK SCREENSHOT BELOW TO ENLARGE]
3) Now, get back to (C:)root, access the "ProgramData" folder. This "ProgramData" is a hidden folder so you will need to configure first the folder properties for Windows 7 (for more info check the tutorial: How to Show Hidden Files in Windows 7).
Now, access hidden "ProgramData" folder. [CLICK SCREENSHOT BELOW TO ENLARGE]
4) Inside the "ProgramData" folder, look for "MySQL" folder. This "MySQL" folder contains stored data such as password applied during the configuration. Delete it. [CLICK SCREENSHOT BELOW TO ENLARGE]
5) After all the tweaky steps. You may now install again your MySQL5.X.X.
Hope that solve your problem if you're installing MySQL in Windows 7 OS.
- I would recommend this guide because I find it useful:
"Learn how to Install Apache, PHP, MySQL and phpMyAdmin" by Bicubica.com