Jump to content

Connecting to a mySQL database behind a firewall


gortron

Recommended Posts

 

PHP can often connect to a remote mySQL databases, but it depends on the hosting provider. Some allow it, some require a pinhole to be created in the firewall and some don't allow any remote connections to their database.

 

Is there any way using items such as PEAR or SOAP to allow PHP to connect to a remote mySQL database that might be blocked in this way?

 

 

 

I believe the answer is no. Regardless if some abstraction layer is used, the database is still accessed via the same port. As such, you'll have to open up the said port to allow outbound connections. While this can be done at the firewall level it's usually a good idea to only grant database permissions at the ip or domain name level when possible. You naturally want to restrict as much access as possible. Just as another good measure if the user is only reading (selecting) records it's best to not give them the ability to update/add/delete records as well.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.