我正在尝试访问microsoft付费SQL数据库。我正在使用以下方法
cnxn = pyodbc.connect('DRIVER={ODBC Driver 13 for SQL Server};Server=myserverhere,1433;Database=serverdb;Uid=myuidhere;Pwd={passhere};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;')每次我运行我得到的文件时,我都遵循他们的安装指令
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnect)')发布于 2017-05-19 04:21:19
似乎您从linux连接到sql服务器时,必须更改驱动程序:
conn = pyodbc.connect(r'DRIVER={FreeTDS};SERVER=myserverhere;PORT=1433;DATABASE=serverdb;UID=myuidhere;PWD={passhere};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;') https://stackoverflow.com/questions/44061199
复制相似问题