Sunday, June 26, 2011

Solution to Error Nr. 1045 MySQL Security Settings if you're using Microsoft Windows 7 Operating System

Are you seeing the below error with your MySQL 5.X.X installation?

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.

^_^



Other Tips/Reference:
- I would recommend this guide because I find it useful:
"Learn how to Install Apache, PHP, MySQL and phpMyAdmin" by Bicubica.com

42 comments:

  1. Thank you very much, it was the hidden folder after all :) Mirek

    ReplyDelete
  2. After hours of trying, this was the fix that done the job. I thank you.

    ReplyDelete
  3. @Mirek and @Anonymous_September 22, 2011 10:29 AM

    ~
    I'm glad my post really helps.
    I thank both of you for reading.
    ^_^

    ReplyDelete
  4. Thank you SO much! I tried reinstalling this so many times... but always got this error. The only thing I failed to delete every time was the mysql folder in programdata. You saved me from more frustration! Thanks again ^^

    ReplyDelete
  5. This fix works perfectly for me. Very clear, idiot-proof instructions.

    Thanks for your time in posting this solution.

    ReplyDelete
  6. thax dear... its work... love u..

    ReplyDelete
  7. @Anonymous_October 22, 2011 10:39 AM
    @Anonymous_November 3, 2011 2:25 PM
    @Anonymous_November 10, 2011 11:29 PM
    @gabru_January 5, 2012 9:35 AM

    ^ Thank you so much guys. I'm really glad I did help with idiot-proof instructions like "Anonymous_November 10, 2011 11:29 PM" said. Thanks. Thanks. Happy New Year to all of you!
    ^_^

    ReplyDelete
  8. thank you,thank you,thank you,thank you,thank you,thank you,thank you,thank you,thank you,thank you, so much....

    ReplyDelete
  9. Thanks!! that worked

    ReplyDelete
  10. Error 1316 is an irritating installation error. It pops up when a software is being installed, uninstalled or repaired on your computer.You may get the following description while seeing this error: Error 1316: "A network error occurred while attempting to read from the file: :\Install.msi"

    ReplyDelete
  11. Thank you. It helped me. Thanks a lot

    ReplyDelete
  12. Worked perfectly! Thank you!

    ReplyDelete
  13. thanx man ..you are unmatchable

    ReplyDelete
  14. worked perfectly, great discovery, you are invincible...

    ReplyDelete
  15. thanks it helps a lot

    ReplyDelete
  16. Thankyou soooooooooooooooooooooooooooooooo very much... where was this hidden... Thanks a lot...
    Finally overcomed my frustration...

    ReplyDelete
  17. hey, hi dear... u r really genious man... thaks a lot my dear... luv u... tc... hav a wonderful journey of lyf,,, thnx 1 again......

    ReplyDelete
  18. Thank you so much for this neat posting.

    ReplyDelete
  19. Sir I am very very thankful of u...
    finally u solved my problem..
    i was facing to this prob from last 7 days..
    really genious person..hv a wonderful life..
    take care
    n thanks again

    ReplyDelete
  20. Thank you very much. You saved my life. :)

    ReplyDelete
  21. thank you so much!! This was the only solution that fixed the error 1045. you do really hit the target!!!!!!!

    SAML
    Haiti

    ReplyDelete
  22. Thank you very much.. I searched a lot for this issue and finally done with it. It helped me a lot.

    ReplyDelete
  23. hats off to u dear.thank u so much

    ReplyDelete
  24. f-ing rock dude. Thanks!

    ReplyDelete
  25. Thank You Very Much!!!!!!!!!!!!!! u ROCK!

    ReplyDelete
  26. thank u so much!!!it helped me and successfully worked

    ReplyDelete
  27. Great work admin...i really wasted 1hr to solve this issue. thank you so much.

    ReplyDelete
  28. thanks a lot u saved me from more frustration.

    ReplyDelete
  29. Thank u so much.
    It works fine.
    --Shivang Modi.

    ReplyDelete
  30. Dear, thank you soooooooooooooooooooooooooooooooooo much
    !!

    ReplyDelete
  31. thanks a lot babe

    ReplyDelete
  32. Thanks so much ... I had been trying to fix this error for last one hour .... your blog post just made my day ... I have successfully installed MySQL Server on Windows 7....

    ReplyDelete
  33. Everyone has already said it but I'll add mine too; THANKS A BILLION!

    On the other hand It's absolutely ridiculous that the MySQL team cannot properly clean up after themselves after an uninstall.

    ReplyDelete
  34. Wow wow Fantastic, it took me hours to get the solution of this problem. Many thanks

    ReplyDelete
  35. Thank you so much

    ReplyDelete