On Linux, another reason that this error might occur is that you are using a binary MySQL version that is compiled with a different version of the glibc  library than the one you are using. In this case, you should either upgrade your operating system or glibc , or download a source distribution of MySQL version and compile it yourself. A source RPM is normally trivial to compile and install, so this is not a big problem. 

•If you specify a host name when trying to connect, but get an error message where the host name is not shown or is an IP address, it means that the MySQL server got an error when trying to resolve the IP address of the client host to a name: 

shell> mysqladmin -u root -p xxxx  -h some_hostname  ver Access denied for user ’root’@’’ (using password: YES) 

If you try to connect as root  and get the following error, it means that you do not have a row in the user table with a User  column value of ’root’  and that mysqld  cannot resolve the host name for your client: 

Access denied for user ’’@’unknown’ 

These errors indicate a DNS problem. To fix it, execute mysqladmin flush-hosts  to reset the internal DNS host cache. See Section 5.1.12.3, “DNS Lookups and the Host Cache” . 

Some permanent solutions are: 

•Determine what is wrong with your DNS server and fix it. 

•Specify IP addresses rather than host names in the MySQL grant tables. 

•Put an entry for the client machine name in /etc/hosts  on Unix or \windows\hosts  on Windows. 

•Start mysqld  with the skip_name_resolve  system variable enabled. 

•Start mysqld  with the --skip-host-cache  option. 

•On Unix, if you are running the server and the client on the same machine, connect to localhost . For connections to localhost , MySQL programs attempt to connect to the local server by using a Unix socket file, unless there are connection parameters specified to ensure that the client makes a TCP/IP connection. For more information, see Section 4.2.4, “Connecting to the MySQL Server Using Command Options” . 

•On Windows, if you are running the server and the client on the same machine and the server supports named pipe connections, connect to the host name .  (period). Connections to .  use a named pipe rather than TCP/IP. 

•If mysql -u root  works but mysql -h your_hostname  -u root  results in Access denied (where your_hostname  is the actual host name of the local host), you may not have the correct name for your host in the user  table. A common problem here is that the Host  value in the user table row specifies an unqualified host name, but your system’s name resolution routines return a fully qualified domain name (or vice versa). For example, if you have a row with host ’pluto’  in the user  table, but your DNS tells MySQL that your host name is ’pluto.example.com’ , the row does not work. Try adding a row to the user  table that contains the IP address of your host as the Host column value. (Alternatively, you could add a row to the user  table with a Host  value that contains a wildcard (for example, ’pluto.%’ ). However, use of Host  values ending with %  is insecure  and is not recommended!) 

