Page 1 of 1

How do I connect to a database on another host?

Posted: Tue Jun 10, 2008 7:41 pm
by lexblago
Hi,

Okay, so I have two hosting services. One on GoDaddy.com and one on Ipower.com. The scripts I have running don't work on the godaddy database setup but they do with the ipower database. Hence my problem.

So, now I'm trying to figure out how I can connect to the ipower database from the godaddy scripts.

Can anyone help with this one?

Re: How do I connect to a database on another host?

Posted: Wed Jun 11, 2008 9:21 am
by deejay
i think you need to contact your hosts at ipower as they will need to set up permissions for an external connection.


Hope that helps

Re: How do I connect to a database on another host?

Posted: Wed Jun 11, 2008 9:49 am
by pickle
In mysql_connect() (or whichever other function you're using), you can specify the hostname. You'll also have to set up your database to allow connections from hosts other than localhost.

Re: How do I connect to a database on another host?

Posted: Mon Jun 16, 2008 2:47 am
by lexblago
Thanks, I really appreciate the help. I actually contacted the two different hosts and neither one of them allows a remote database connection. LOL. Thats soooooo garbage! Thanks anyway!

Re: How do I connect to a database on another host?

Posted: Mon Jun 16, 2008 1:24 pm
by VladSun
Do they allow you to use SSH shell? If yes, then you may use SSH tunneling...