PHP/MySQL/Servers

Associate
Joined
21 May 2006
Posts
327
Hello all, if I have got a MySQL database located on 1 server is it possible to have a page hosted on a different server read data in that database as long as I set the right permisions....

Cheers
 
Yes thats fine!

Large sites typically have a separate server for the database, then other servers for webpages and images etc.

On the database server you simply have to create a user account that is allowed remote access.
 
But, as said, some hosts deliberatly set it up to disallow it :( So ask your host to make sure they allow it!
 
All the cpanel hosts I've used allowed it.

Just a case of adding either the ip or a wildcard to the access list.

If its your own server then you can do whatever you like.

OP doesn't state any host info.
 
Yeah I've only use a couple of cPanel hosts and they've both allowed it :D I rekon hosts that have more generic control panels tend to give more control over what you can do with your hosting :)

But 1and1, for example, don't allow remote connection to their db... which is a bummer - the main reason I decided not to go with 1and1 for hosting. Plus I don't like their custom control panel, from what I've seen of it anyway!
 
If not could you setup a file on the database server that ready is a line of text (the query) and then executes it and returns the result? Like a simple AJAX or something?
 
If the mysql server is bound to localhost or to a UNIX domain socket (file socket) on the server, you could still use SSH tunnelling or somesuch. Just keep the connection persistant otherwise the setup-overhead would be painful.
 
Back
Top Bottom