Welcome Guest | Login

MySQL Remote Connection

I am trying to connect to a remote server from my local client. I have added my IP address to the Remote Database Access Hosts file through cPanel. I am getting this error: Can't connect to MySQL server on 'servername'. Any suggestions?

Thanks in advance

2008-07-05 08:02 AM

Hi - Are you able to connect to the server via ssh ?

Also please try if you are able to connect to MySQL database via ssh console. Thank you

2008-07-05 08:36 AM

HostingRails Support
Hi, thanks for the reply.
I am able to connect to the server via ssh and can connect to the MySQL database via ssh console.

2008-07-05 07:29 PM

I am also having the same problem. I am not able to connect to the MySQL server from a remote location. In mysql the username I'm trying to log in with has permissions from all hosts. I am guessing port 3306 may not be enabled by default? If so, how should I go about enabling it on the machine?

2008-07-06 12:30 PM

Ok...Are you trying to connect via command-line or are you using any third party tool for the same. Can you try connecting to the mysql server via command line using the following command syntax

$ mysql -u <mysqlusername> -D <databasename> -h <IP address of mysql server> -p

>>I am guessing port 3306 may not be enabled by default?
On the shared servers this port is enabled by default. If you want to check whether this port is enabled at your local end, then try the following command..

$ telnet domain-name 3306

If this times out then its obvious that the port is disabled..

2008-07-06 12:51 PM

Regards,
Rahul
Yeah, I tried that telnet <domain> 3306 and it times out on both the domain name and the ip address of our shared server. What can I do to enable the port? We have the webmin interface but I can also run something through command line ssh if needed.

2008-07-06 01:21 PM

Well..In that case you will need to enable port 3306 at your local end. Try disabling the local firewall set up and check the  connectivity from your end to the server

2008-07-06 02:14 PM

Regards,
Rahul
I don't think there's a problem with the port on my local end since I can connect to other servers through port 3306. I just can't connect to it for this server. I am trying to connect using the "MySQL Query Browser" tool from mysql.com which will connect to other SQL servers, just not the one at hostingrails.com. I have also tried connecting via a php script hosted on an outside server and it times out as well. What it looks like isI just need to open the port on our hostingrails.com server but I don't know the correct process to do so.

2008-07-06 02:24 PM

>>What it looks like is I just need to open the port on our hostingrails.com server but I don't know the correct process to do so.

Ok. Just noticed that you are on a VPS. I have enabled the 3306 port of your VPS now. The file where you need to edit is /etc/apf/conf.apf

Here you will need to enable the port in the "Common inbound (ingress) TCP ports"

Can you check the status now..

2008-07-06 03:04 PM

Regards,
Rahul
Yeah, that fixed it. Thanks for the help!

2008-07-06 03:11 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.