我正在尝试使用以下方法从 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
如有任何建议/建议,我们将不胜感激。
提前致谢