Re: How to seperate the web server and MySQL database server?
| From: | Jason Wong | Date: | Sat, 04 Jan 2003 20:07:32 +0000 |
| Subject: | Re: How to seperate the web server and MySQL database server? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24552@lists.php.net to get a copy of this message | ||
On Sunday 05 January 2003 02:54, Qunfeng Dong wrote:
> Hi, I am sure this is a silly/easy question but I
> really hope someone can point me some documents.
>
> We are currently running PHP and MySQL at the same
> machine. Can I run PHP in one machine and MySQL server
> in another machine? If so, how can I make the database
> connection? Currently, in all my PHP scripts, they
> connect to the database through
>
> @ $db = mysql_pconnect("localhost", "UNAME",
> "PASSWD");
>
> can I just replace localhost with the host name of
> MySQL machine? What else should I worry about?
Basically yes. But you need to tell mysql to allow remote connections
(checkout the GRANT command).
Also if you have a firewall between the two machines you would naturally have
to take that into account.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Cure the disease and kill the patient.
-- Francis Bacon
*/