Connecting to MySQL as <IP address> instead of <machine name>
I am using the mysql.exe command-line client on Cygwin and I'm trying to connect to another machine's MySQL (be it on Linux or Windows). My connection always gets refused stating that "Host 'mywindowsmachine' is not allowed to connect to this MySQL server.
On the host, I have granted all permissions to my client machine's IP address, 192.168.0.3 in the user table, but not to it's machine name. Is the latter mandatory? Is there any way for my host to recognize the client's IP address (and accept it as such) regardless of its name ?
If you have granted yourself access privileges using the IP address form for the GRANT statement, the most likely problem is that you are trying to access a machine that is on the other side of a gateway which is translating your client machine IP address to something else.
According to my reading of the fine MySQL manual, if you specify an address form in the host table, it will check the source address of the connection for a match. Since that fails, it seems likely that, by the time the server sees the connection request, the IP address is no longer 192.168.0.3.
Your choices here are limited:
1. You can grant yourself privileges to connect from any host (%).
2. You can grant yourself privileges to connect from any machine behind the NAT by specifying the
apparent IP address that the server will see.
3. You can set up some sort of IP tunneling between your LAN and the network that the server is on,
so that your (tunneled) address is not changed.
Thank you for your answer. I did have an issue with NAT. Thanks again.
|All times are GMT -5. The time now is 04:15 PM.|