MySQL Remote Connection
Posted by: selimy (---.ttnet.net.tr)
Date: December 27, 2007 09:29PM

Dear All,

Is there anyone who knows how to allow MySQL remote connection?

Options: ReplyQuote
Re: MySQL Remote Connection
Posted by: toivo (---.nsw.bigpond.net.au)
Date: December 27, 2007 09:59PM

Hi,

There are a couple of things you need to do:

If your WAMP server runs Windows Firewall, open the TCP port 3306. You may want to change the scope to limit the connections to the local subnet or to a particular IP address only.

If you are planning to connect to the MySQL service from outside your network, you need to open TCP port 3306 in the firewall router which connects your network to the internet, and forward the port to your WAMP server. Again limit the incoming connection to an IP address where the requests are coming from, if you can.

In the User Administration part of MySQL Administrator or PHPMyAdmin you need to create the user who will connect remotely. Add the host from where you connect to MySQL under that user, and assign the schema privileges to that host.

The name of the host can be tricky, if the connection comes from the internet, the name of the domain will be part of the host name. Check the MySQL logs for failed connection attempts and amend your host information accordingly.

Regards,

toivo
Sydney, Australia



Edited 2 time(s). Last edit at 12/27/2007 10:04PM by toivo.

Options: ReplyQuote
Re: MySQL Remote Connection
Posted by: selimy (---.ttnet.net.tr)
Date: December 27, 2007 11:25PM

Hi Toivo,

Let me explain what I did/tried so far;

* Firewall settings are OK,
* I have binded an IP address to the MySQL server so that it can be rached through the IP address and not 'localhost',
* I tried to adjust the user privileges to have full control on the realted table,

Still no connection! But wait no error log. Dows this means that we dont even reach the server?

Options: ReplyQuote
Re: MySQL Remote Connection
Posted by: toivo (---.nsw.bigpond.net.au)
Date: December 28, 2007 06:04AM

Hi,

Make sure the IP address bound to the Windows workstation or server on which your MySQL server and WAMP run is a valid internal IP address in the subnet controlled by the router or firewall through which the requests from the internet come into your network and are then forwarded to the box running the MySQL server.

If you can connect to MySQL server using that IP address from inside the LAN and if TCP port 3306 is forwarded to the same server from the router facing the internet, you should be able to connect at least to the MySQL server to see an error message.

Try the connection from MySQL Administrator in the LAN and you may succeed, or see the error message:
"Could not connect to the specified instance. MySQL error number 1045. Access denied for user xyz@10.0.0.15".

Pay attention to the format of the username, for example xyz@10.0.0.15. You need to have the host 10.0.0.15 listed under the user xyz, with access to the particular schema, to get access to that database.

You can use the same technique to find out the details when accessing the server from outside your network. Check the format of the user and host from the error message and adjust those details in the User Administration. You do not want to grant access to everyone, do you?

Regards,

toivo
Sydney, Australia

Options: ReplyQuote
Re: MySQL Remote Connection
Posted by: selimy (---.dynamic8596130216.ttnet.net.tr)
Date: December 29, 2007 07:30PM

Hi Toivo,

Thank you for helping. It was the firewall of the network actually. And I discovered it trough you suggestion of investigating the log smiling smiley)

Options: ReplyQuote


Sorry, only registered users may post in this forum.