LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-28-2008, 09:51 PM   #1
narc
Member
 
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68

Rep: Reputation: 15
Connecting to MySQL as <IP address> instead of <machine name>


Hello.

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 ?

Thanks.
 
Old 07-28-2008, 11:39 PM   #2
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
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.

Good luck.
 
Old 07-29-2008, 10:04 AM   #3
narc
Member
 
Registered: Aug 2004
Location: Montréal
Distribution: Linux from scratch
Posts: 68

Original Poster
Rep: Reputation: 15
Thumbs up

Thank you for your answer. I did have an issue with NAT. Thanks again.
 
  


Reply

Tags
cygwin, mysql, permissions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restarting Windows machine stops Linux machine mounting/connecting jamespetts Linux - Networking 3 05-29-2008 03:12 AM
How to find an IP address from the MAC address of a remote machine ? jitz Linux - General 3 01-03-2006 07:55 AM
How to find IP address of a machine if I know their MAC Address dysenteryduke Linux - Networking 13 09-12-2005 10:21 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
Mysql is not connecting from servlet.But connecting from java, help pls Harish_f Linux - General 0 05-08-2002 03:21 AM


All times are GMT -5. The time now is 06:17 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration