PDA

View Full Version : How do i connect to a remote database from bh?



modpriest
07-27-2007, 05:56 AM
I have a website on bh. I want to know who i can connect to remote database from bh. Do i need to setup proxy or something?:confused: :confused:

charlesgan
07-27-2007, 11:11 AM
no need for proxy, it will cause problem in this only. :)

from cpanel>mysql.... add remote hoste (your IP). so that your computer can get access to BH server mysql.

then from your pc, mysql connect to your database at the server. done.

modpriest
07-27-2007, 11:39 AM
then how do i connect from bluehost shared host website to a outside database? :confused:

adddfico
07-28-2007, 06:26 AM
Something like this?

mysql_connect ("IP of remote server", "USERNAME", "PASSWORD") or die ('I can't connect because: ' . mysql_error());
mysql_select_db ("DATABASE");

for php or command line like this:

mysql -uUSERNAME -pPASSWORD -hHOST

That work for you?