当前位置:Gxlcms > 数据库问题 > Python操作sqlserver 2000

Python操作sqlserver 2000

时间:2021-07-01 10:21:17 帮助过:12人阅读

但是我是在Ubuntu中,需要安装下面的组件:

  Microsoft ODBC Driver for SQL Server on Linux

该组件的13版支持Ubuntu了,之前的11版支持centos和redhat,果断安装13版。

按照https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server 步骤安装完该组件,

然后按照 https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-RHEL-or-Centos  的步骤搞完收工。

本来以为可以收工了,但是, 当我 pyodbc.connect(‘DRIVER={ODBC Driver 13 for SQL Server};SERVER=192.168.1.15;DATABASE=master;UID=sa;PWD=password‘)竟然显示不支持sqlserver2000!!!  what fuck!!

于是用了另一个模块: pymssql

这次终于成功了。

 

参考

  https://www.tomczhen.com/2017/05/25/python-cross-platform-connect-to-sqlserver/

  https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

  https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-RHEL-or-Centos

  

Python操作sqlserver 2000

标签:tin   oss   操作系统   password   blank   drive   master   from   base   

人气教程排行