'Cannot connect to Databricks SQL Endpoint using PHP and ODBC
I am trying to connect to our Databricks SQL endpoint using PHP in a Docker container.
I setup my Docker container to download and configure the ODBC driver as specified here: https://docs.databricks.com/integrations/bi/jdbc-odbc-bi.html#install-and-configure-the-odbc-driver-for-linux
My Docker setup is at https://github.com/rlorenzo/databricks_php
However, when it try to connect using ODBC from my PHP test script I get the error:
Warning: odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /test_connection.php on line 14
ODBC connect failed: S1000
When I try to connect using the PDO library I get a different error message:
SQLSTATE[08S01] SQLConnect: 20009 [unixODBC][FreeTDS][SQL Server]Unable to connect: Adaptive Server is unavailable or does not exist
The connection details are correct because I was able to connect to the Databricks SQL endpoint using Datagrip. I can also verify that the ODBC library is properly installed because I can query a Microsoft SQL Server.
I must have the Databricks ODBC Connector misconfigured somehow, but I am clueless. From my view everything matches the documentation.
I have tried contacting Databricks support, but they have been unhelpful so far.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
