...

View Full Version : Connect to MySQL database from another host.



gamehosting
07-16-2006, 11:11 PM
I am trying to connect to MySQL database at on host (DBhost) from another host (PROGRAMhost).

While I try to connect to the database at DBhost from DBhost itself the next is working fine for me:
mysql_connect("localhost","dbname","dbpassword")

Now I am trying to find out what to use instead of localhost? I tried to replace localhost with host's url : port (I tried number of ports) but this is not working (even when I am connecting from DBhost itself). How can I find out what is the proper value to use instead of localhost?

vinyl-junkie
07-17-2006, 12:15 AM
I assume that you have permission to be able to logon to one host's database from the other, so why not just ask them how to do it? An even bigger question would be why you're wanting to do this in the first place. Are you trying to port a database from one server to another? If so, and both hosts use cPanel, you can use that to do the database move. If one or both do not use cPanel, there still might be an easier way to do this. Again, check with the appropriate host to find out.

gamehosting
07-17-2006, 12:46 AM
Well, both hosts are mine but that is what my client wants - to separate (physically) the information from the processing. I don't really like this as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum