Databricks 到 SQL 连接错误:[unixODBC][驱动程序管理器]无法打开库“SQL Server 的 ODBC 驱动程序 17”

问题描述 投票:0回答:0

我正在尝试使用以下方法从 Databricks 连接到 Azure SQL

import pyodbc

# Connect to Azure SQL database
server = 'xxxx.database.windows.net'
database = 'db-dev-xxxx'
username = 'abc'
password = 'xyz'
driver= '{ODBC Driver 17 for SQL Server}'

cnxn = pyodbc.connect('DRIVER='+driver+';SERVER='+server+';PORT=1433;DATABASE='+database+';UID='+username+';PWD='+ password)

但是,我得到以下错误

错误

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server': file not found (0) (SQLDriverConnect)")
Command took 0.19 seconds -- by [email protected] at 3/1/2023, 3:59:15 PM on g @xxx.onmicrosoft.com's Cluster

如有任何建议/建议,我们将不胜感激。

提前致谢

python sql database azure-databricks databricks-sql
© www.soinside.com 2019 - 2024. All rights reserved.