views:

292

answers:

4

Hi

I want to connect to mySQL database which is located in a web-server (siteground) which is a web hosting company..

can this be achieved , is there a port to connect to the mysql database like (3306).

if not , are there any servers online where this can be achieved?

PS: I'm using Delphi, and I'm using mysql locally using odbc.

+3  A: 

It depends on your hosting provider, you would have to ask them. 3306 is usually the right port.

Usually, though, that port is closed for access from outside for security reasons.

Pekka
A: 

I guess you can but you have to enable it. Try reading documentation

You can allow access to MySQL databases from an external location by adding its domain name or IP address to the list of hosts that are allowed to access your databases remotely. Additionally, if you would like to manage your database using an application for remote database management, the IP address from which the connection is established should be added to the list of allowed hosts.

In order to add allowed hosts you should access the tool via cPanel -> Remote MySQL:

In the Host field you should enter the desired domain name or IP address:

Click on the Add host button.

A confirmation message will inform that the host is successfully added. Next time you access Remote MySQL the newly added host will be listed under Access Hosts.

radious
A: 

If you have ssh access to your hosting provider you can create a tunnel and then route all local traffic to it. In your local machine do something like this:

ssh -L3306:localhost:3306 [email protected]

provide your password and the machine on which you executed the ssh command will have port 3306 redirected to the hosting provider. This is, if you connect to localhost:3306 on the machine on which you executed the command it will actually be connecting to the hosting provider.

rmarimon
A: 

Thank you very much everybody.

problem solved! :D

I contacted the support at the hosting company, and they told me its possible and gave me this useful link

http://kb.siteground.com/article/I_have_problems_accessing_my_mysql_database_remotely.html

all I had to do is to add a 'remote mysql host' which is my ip, and then I added the database to the windows odbc and it worked fine, as if it where local db (only slower).

vegatron