Bug #59758 skip_name_resolve access denied for root@127.0.0.1 or root@localhost
Submitted: 26 Jan 2011 20:58 Modified: 15 May 2011 17:46
Reporter: bill bill Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.5.8 MySQL Community Server (GPL) OS:Windows
Assigned to: CPU Architecture:Any
Tags: access denied, root, skip_name_resolve

[26 Jan 2011 20:58] bill bill
Description:
If you include skip_name_resolve in the my.ini or my.cnf

you will get access denied for both:

access denied for root@localhost 

and 

access denied for root@127.0.0.1

and will only be able to connect with user accounts already granted for 127.0.0.1

How to repeat:
default install mysql 5.5.8 on windows
add to config under mysqld:
skip_name_resolve 

try to connect with root using any method, command line, ODBC, or dotnet and it fails with access denied.
remove that entry, restart, login with root at localhost, add record for root@127.0.0.1 with:
 
grant all on *.* to root@'127.0.0.1' identified by 'something';

put back skip_name_resolve , restart mysql, 
then it works fine and as expected with skip_name_resolve 

Suggested fix:
In the older versions, the default installation included insertion of root user records for both root@127.0.0.1 and root@localhost.  

A) Put back that into the installer script/code that inserts a record for both localhost and 127.0.0.1 .

B) or fix the logic with the name lookup 
and/or conversions from localhost to 127.0.0.1 or the reverse

I'd bet it is the same for all platforms, since I have long ago adjusted my user code generation scripts to include grants for both 127.0.0.1 and localhost to prevent unexpected connections errors.  There is more to this than just 
skip_name_resolve  which requires both grant records to exist. A simple search on localhost and 127.0.0.1 should located them easily enough. In some cases, depending on the ODBC or dotnet connector version
[15 Apr 2011 17:46] Valeriy Kravchuk
Please, check if the same problem still happens with a newer version, 5.5.11.
[15 May 2011 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".