Forum Moderators: coopster

Message Too Old, No Replies

Developing using remote database

Is it possible?

         

Mark Barrett

1:56 pm on Jun 12, 2005 (gmt 0)

10+ Year Member



Up to now when developing a new PHP script I have used test data in a local MySQL database, therefore:
mysql_connect("localhost" etc.

Can I, instead, connect to the live MySQL database which is on a remote server.

If so, what will be the format of the "host name" that replaces "localhost"

Again, if so, can I get that information myself (e.g. using PHPMyAdmin) or do I have to get it from the host server company.

Thanks for any guidance here.

Mark Barrett

moltar

2:07 pm on Jun 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to specify the exact address of the remote machine - fully qualified domain name or IP address. You most likely already know the machine name (the website's domain?).

Many hosting providers block incoming connections to mysql from outside world. They allow connections to be made only from the same machine that the script is running on.

Though, I've seen one ISP with cpanel where cpanel allows to "white list" a certain remote IP to allow the connection.

Mark Barrett

2:19 pm on Jun 12, 2005 (gmt 0)

10+ Year Member



moltar

Thanks for that.

Many hosting providers block incoming connections to mysql from outside world. They allow connections to be made only from the same machine that the script is running on.

My gut feel was that that would be the case.

I'll contact my ISP tomorrow just on the off chance.

I appreciate your prompt reply

Mark Barrett