Example of connecting to Databricks using PHP in a Docker environment
Make sure you have Docker Desktop installed.
- Copy odbc.ini.dist
cp -p odbc.ini.dist odbc.ini
- Edit odbc.ini and replace the values in it with your Databricks SQL endpoint connection details
- Replace <SQL_ENDPOINT_SERVER> and <SQL_ENDPOINT_HTTPPATH> with values found under the "Connection details" tab for your Databricks SQL endpoint.
- Replace <PERSONAL_TOKEN> with the your account's Personal Access Token.
- Copy config-dist.php
cp -p config-dist.php config.php
- Edit config.php and replace <PERSONAL_TOKEN> with the your account's Personal Access Token.
- Build the container
docker build -t databricks_php .
- Run the test connection script
docker run databricks_php