Ok I'm asking this question since I tried looking for an answer for the last 4 hours.
I don't even know what I did in the server that it won't allow me to connect from the local host. but even after installing anything related to the mysql installation and reinstalling only the server it won't let me connect.
when I try to configure the server after I just installed it on the apply security settings it fails and give me that error.
My server is installed on a regular PC and not on any website, the PC runs a win 7 and I tried the skip-grant-tables option as well as the removing the registry keys after uninstalling the server.
Please if anyone has any other option for me to use or if you think I did something wrong in these other options please tell me how can I fix that doing the right thing and how to do that.
解决方案
I also had this same problem when installing a new version of mysql5.5, but i solved it.
If you go through the path mysql was installed in, in windows your windows system, "c:\mysqlinstalllocation\bin"
you can run the mysql query from this directory,
but if you have already added the mysql command to the path option in windows, in environment variables, which will help you run custom commands form the command line, you can run it directly from any directory in the command prompt.
Just add the "skip-grant-tables" command under the [mysqld] heading in the mysql.ini file, and make sure to restart your server after doing this, and run mysql, it will work. At this point you will login without any password, so it's advisable to delete the password at this point, so you can login easily after you've uncomment the skip-grant-tables" command
And after you've removed the password from the root user, make sure to remove the "skip-grant-tables" command, or comment it out, with #, then restart your server. It will work.
Now you can login without any password, and run the grant command, and set any password you like.