Forum Moderators: coopster

Message Too Old, No Replies

connecting to external php database

         

NancyJ

9:41 pm on Feb 9, 2005 (gmt 0)

10+ Year Member



I'm moving my site from one server to another and eventually I will be rebuilding the site with a new DB etc but for now I just want to access my mySql database from a different domain and server - is this possible?

dmmh

10:31 pm on Feb 9, 2005 (gmt 0)

10+ Year Member



Yes it possible

$ip = '222.333.666.44';
$user = 'mysql_user';
$pass = 'password';
@mysql_connect($ip, $user, $pass);

if you get an message you cannot connect, uncomment "skip-networking" in my.cnf (mysql)

NancyJ

10:45 pm on Feb 9, 2005 (gmt 0)

10+ Year Member



how do I find out my IP? heh I have the IP for my new server but I dont think I ever got one for the old one....

jatar_k

11:10 pm on Feb 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



the hostname works as well

dreamcatcher

12:22 am on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think it depends on the server and if they block access or not. Some servers (like mine) require you to have a static IP address for you to make an external connection to their databases.

Just a thought.

NancyJ

8:30 am on Feb 10, 2005 (gmt 0)

10+ Year Member



dug out my old welcome email and it did have the IP in, its working great! Thanks :)

dmmh

8:50 am on Feb 10, 2005 (gmt 0)

10+ Year Member



welcome :)