Link to home
Start Free TrialLog in
Avatar of utpal_nandi
utpal_nandi

asked on

Not able to connect to MySQL from client machine

Hi everybody,

I have successfully installed my first MySQL based VB6 application on the server. I have used the connection string

"DRIVER={MySQL ODBC 3.51 Driver};SERVER=merline;DATABASE=test;USER=merline;PASSWORD=password02;Port=3306;OPTION=3;", which is working absolutely fine on the server.

However, when I try to run the application from a client machine using the connection string "DRIVER={MySQL ODBC 3.51

Driver};SERVER=merline;DATABASE=test;USER=ADMIN;PASSWORD=password02;Port=3306;OPTION=3;", the following error message shows up: "Host '192.168.0.20' is not allowed to connect to this MySQL server.". 'ADMIN' is the host name of the client machine.

I have created the user 'ADMIN' & granted rights to it with the following commands:
CREATE USER 'ADMIN'@'merline.srpfpl.com' IDENTIFIED BY 'password02';
GRANT ALL ON *.* TO 'ADMIN'@'merline.srpfpl.com';

I have also tried replacing 'ADMIN' with '192.168.0.20' in the above 2 commands, but still it doesn't work.

Please help me out.
Avatar of Raynard7
Raynard7

If you use mysql administrator - one of the startup options is "disable networking" if this has been chosen then it will not allow you to connect.

The problem does not seem to be one about the user as this generally gives a different message - the host (the computer you are trying to connect from) is not being allowed by the server.

The fact that you are getting the error message you are means that you are actually talking to the server - meaning you have the correct port; it just has a problem with your machine.

universal remote host is noted with '%'.
so instead of 'merline.srpfpl.com' or '192.168.0.20' try '%'.
Avatar of utpal_nandi

ASKER

What could be the problem with the machine?  Is it hardware problem or OS problem or Firewall blocking the port?  What could be the possiblities?
As Z03niE said the problem relates to the fact that no users have the ability to connect from that given machine - try % and it should work.

It is not likley to be a problem with the machine.

The fact that you can connect locally means it should be good.

Try

CREATE USER 'ADMIN'@'%' IDENTIFIED BY 'password02';
GRANT ALL ON *.* TO 'ADMIN'@'%';

And see if that works.
To user universal remote host do I have to run the commands like this?:
CREATE USER '%' IDENTIFIED BY 'password02';
GRANT ALL ON *.* TO '%';
OK I'll try that
On trying:

CREATE USER 'ADMIN'@'%' IDENTIFIED BY 'password02';
GRANT ALL ON *.* TO 'ADMIN'@'%';

I got the following error message on trying to connect to MySQL server from the machine 'ADMIN':

MySQL ODBC 3.51 driver access denied for user 'admin'@'ADMIN' (using password 'YES').
Try

update mysql.user set user='ADMIN', host='%', select_priv='Y', insert_priv='Y', update_priv='Y', delete_priv='Y', create_priv='Y', drop_priv='Y', reload_priv='Y', shutdown_priv='Y', process_priv='Y', file_priv='Y', grant_priv='Y', references_priv='Y', index_priv='Y', alter_priv='Y' where user='ADMIN' and host='%'

as your query,

also remembering that usernames can be case sensitive - so ADMIN is different to admin
Even after running the update command, I still get the same error message:
MySQL ODBC 3.51 driver access denied for user 'admin'@'ADMIN' (using password:YES).

SOLUTION
Avatar of Raynard7
Raynard7

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Finally the following worked:

CREATE USER 'admin'@'%' IDENTIFIED BY 'password02';
GRANT ALL ON *.* TO 'admin'@'%';

The problem was with the case.  Many many thanks to both!!