Access a database that is external to InfinityFree

Hello, I wanted to know if it is possible, via php, to use an external database from that of InfinityFree.
For example, use InfinityFree as a web host and my.mysqldb.com as a database.
Is it possible to do that?

Due the security system. I don’t think if you can connect to an External database. It’s possible to connect to IF databases only,

As far as I know, there is no restriction on connecting to external databases from our hosting. Simply setup a script with PDO, MySQLi or any other piece of code which handles the database connection for you and plug in the details of your database at your external database host.

Fair warning though: MySQL connections are quite sensitive to latency, and a couple of extra milliseconds on the connections can wreck the performance of anything using it. If you just need to do an occasional remote lookup, then it’s probably fine. But if you actually use it as a transaction database for a web application, you may want to make sure that there is a fast and short connection between your web hosting account and your database.

3 Likes

Thanks, I will try as soon as possible, the website will use the Mysql only in a few occasions, to log in or to print some data.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.