Page 1 of 1

PHP + Remote MySql connection question

Posted: Tue Jun 17, 2008 4:28 am
by mukul_chou
I have been told that to connect a MySql database through php the MySql server has to be physically installed on the same server as the apache. Is it true? A little bit of search indicates not. I came to know php can connect to MySql through TCP/IP and socket. Tcp/ip is default. For socket connection I came to know MySql server has to be physically installed on the same server as the apache [ref. phpMyAdmin documentation]. What about tcp/ip? A real test consisting different physical server will resolve the matter for sure. But availing 2 physical server (/pc) is bit difficult for me.

Re: PHP + Remote MySql connection question

Posted: Tue Jun 17, 2008 5:34 am
by WebbieDave
mukul_chou wrote:I have been told that to connect a MySql database through php the MySql server has to be physically installed on the same server as the apache. Is it true?
No. In fact, the first parameter to the mysql_connect function is the server name.