1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Cloud server: logging in to an external database
This guide explains how to connect to an external database from an Infomaniak Cloud server.
PHP_PDO_ODBC
It’s possible to install the PHP_PDO_ODBC extension from the PHP Extensions menu on your Cloud server:
- Log on to your Infomaniak space (manager.infomaniak.com)
- Go to
Cloud Server and select the server concerned
- From the left side menu choose PHP Extensions
- Click on the blue button Install an extension
- Choose the extension PHP_PDO_ODBC
- Confirm the installation
If you don’t have the PHP Extension menu from the admin console of your Infomaniak Cloud Server, you’ll need to migrate to our new generation Cloud Servers.
We don’t install PDO_DBLIB.
Connector
The connector information must be defined statically in the file /etc/odbc.ini or in the user’s home ~~/.odbc.ini but also dynamically in the PHP code.
Example with the FreeTDS driver predefined, the driver version must also be specified at the end of the declaration of the pdo object:
$con = new PDO('odbc:Driver=FreeTDS;Server=__SERVER IP__;Port=3306;DATABASE=__DATABASE NAME__;UID=__USERNAME__;PWD=__PASSWORD__;TDS_Version=8.0');