Description:
As a result of the action on bug 11822, it's no longer possible to initially connect to noinstall Windows builds of MySQL if the hostname for 127.0.0.1 is not localhost (either CookieCop in the case I had, or empty, will fail because of the hostname). The problem is made harder to diagnose because the hostname cache will cache the incorrect hostname value, so just changing the hostname isn't enough, you also need to know about the hostname cache and know that you need to restart the server to flush the cache between each attempt.
Suggestion: don't cache the hostname until there has been at least one successful connection to the server. Alternatively, don't cache until at least one successful connection only when the attempt is for 127.0.0.1 and root, since that's the pair which matters just after an install.
I've only checked noinstall builds. Chances are that the installer builds are also affected.
How to repeat:
Use a noinstall Windows build 5.0.10b or later on Windows XP with localhost set to CookieCop and try to connect. Will be refused because hostname CookieCop isn't allowed to connect even though you're connecting from 127.0.01. Change the hosts file to contain "127.0.0.1 localhost", ipconfig/flushdns and try to connect again without restarting the server. Still fails because of the hostname cache. Restart the server and it'll work.
Suggested fix:
Prior to bug 11822 this wasn't an issue - the server would accept connections from 127.0.0.1 even when the hostname was not localhost. Restoring that behavior would be even more helpful.