If you get access denied error, using an authentic user, while connecting to MySQL database. You should take certain things into consideration.

MySQL has user as well as host level controls.

As if you have defined access to particular machine and user has all rights, still the user can’t logon from other machine.
You should check by executing things

mysql –u root mysql

Execute following select statement to check the user rights for particular machine

select * from user where user=’user_name’;

This will return some row, if you know this user is able to work from other computer. The column host and user should have information of current client name and user name in this list. If the host name is not included your will get following error

Host ... is not allowed to connect to this MySQL server

You can fix this by two ways.

1. You can add the host information in user table as

a. Connect mysql schema from the user is able to connect and insert value for this user and this host

b. If you are not aware of IP address or host name of that machine, you can provide access to this user from all machine on this network using ‘%’ as wild character in host column.

In mysql you are allowed to make changes in mysql schema with DML statement.

On Linux operating system, alternative cause that this error might occur is that you are using a binary MySQL version that is compiled with a diverse version of the glibc library than the one you are using. In this circumstance, 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 usually trivial to compile and install, so this is not a great difficulty.

We will discuss one more possiblity of this error.

If you specify host name in connection string as like this

shell> mysqladmin -u root -pxxxx -h some_hostname ver

You still receive following error

Access denied for user 'root'@'' (using password: YES)

This error shows that the ‘root’ is user which is trying to get authenticated. And it shows that password has been provided in authentication detail. But the part after ‘@’ shows that host from where it is trying to get attempted.

It means mysql server got error while resolving this the IP address.

And If you get following error

Access denied for user ''@'unknown'

Shows that the user user '' which is trying to get authenticated don’t have any row in mysql table.

MySQL Archives