cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' :

zmsoft
New Contributor III

Hi there,

My cluster version is 15.4 LTS, and the workspace has UC enabled. When I used the initialization script to install ODBC Driver 17 for SQL Server, there were no errors and the cluster started successfully. But when I use ODBC Driver 17 for SQL Server in the notebook to update the database record, I get an error.

Any suggestion?

Thanks & Regards

7 REPLIES 7

MarcusC
New Contributor III

Is it not possible for you to use the built in sqlserver-driver?
Sample code for reading below

spark.read \
        .format("sqlserver") \
        .option("host", "xxx.database.windows.net") \
        .option("database",database) \
        .option("dbtable", table) \
        .option("accessToken", access_token) \
        .option("encrypt", "true") \
        .option("hostNameInCertificate", "*.database.windows.net")

zmsoft
New Contributor III

Hi @MarcusC 

I want to update database rows using the odbc driver

APat449
New Contributor II

Is there any update on this issue? is it solved?

zmsoft
New Contributor III

In Unity catalog environment, if you want to using odbc driver to update database rows, you need to create a volumn, and put the odbc install script file to volumn, then add allow list. After that you can modify computer configuration to add init script. When odbc driver install successfully, you can using odbc driver now.

APat449
New Contributor II

thanks for your quick response..
so if I understand correctly, you are asking to create an init script and put it in UC Volume, and then use that path in the DBK cluster's init script?

and as teh INIT script are you referring to something like this?

curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
# Install msodbcsql18
apt-get update
ACCEPT_EULA=Y apt-get --quiet ---yes install msodbcsql18



APat449
New Contributor II

Also is INIT script route is the only route? or is there any other option available?
the reason I am asking, some time back we had a call with DBK and then they mentioned like usage of INIT script is not the right way or so.. cant recall exact explanation though.

zmsoft
New Contributor III

I think INIT script is the only way, because when you run the script in notebook, you will get error message, it says you are not root need password.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group