Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Connect a Cloud Server to an external database
Update 08/06/2026
This guide explains how to connect to an external database from a Cloud Server.
Introduction
- It is possible to connect to MySQL via SSL (whether external or not) - this should be specified when establishing the connection.
- The MySQL port
3306is closed by default - to open it, please refer to this other guide. - Infomaniak does not install
PDO_DBLIB.
Install PHP_PDO_ODBC
Prerequisites
- You must have the PHP Extensions menu in the Infomaniak Manager, under the Cloud Server section (if not, you will need to upgrade your Cloud Server).
You can install the PHP_PDO_ODBC extension from the PHP Extensions menu of your Cloud Server:
- Click here to access the management interface for your product on the Infomaniak Manager (need help?).
- Click directly on the name assigned to the product in question.
- Click on PHP Extensions in the left-hand menu.
- Click on the blue Install an extension button.
- Choose the
PHP_PDO_ODBCextension. - Confirm the installation.
Configure the connector
The driver configuration is already defined in /etc/odbcinst.ini:
[FreeTDS]
Description = MS SQL database access with Free TDS Driver
Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.soThere is no need to redefine it statically in the .odbc.ini or in the user's home directory ~~/.odbc.ini, or even dynamically in the PHP code.
For example, with the FreeTDS driver defined beforehand, the driver version must also be specified at the end of the pdo object declaration:
$con = new PDO('odbc:Driver=FreeTDS;Server=__SERVER IP__;Port=3306;DATABASE=__DATABASE NAME__;UID=__USERNAME__;PWD=__PASSWORD__;TDS_Version=8.0');Link to this FAQ: https://faq.infomaniak.com/895
Has this FAQ been helpful?