pyodbc 操作错误 08001 ssl 安全错误
pyodbc operational error 08001 ssl security error
我正在尝试使用 pyodbc 从我的笔记本电脑(在 Windows 10 上)通过以下 python 脚本连接到我在 MS SQL Server 2016 上的数据库,并计划将代码部署在 Linux RHEL 6.4 服务器中。
conn=pyodbc.connect('Driver={SQL Server};'
'Server=DB_Instance;'
'Database=DB_Name;'
'UID=user_name;'
'PWD=password;'
'Trusted_Connection=no;');
在我的笔记本电脑上,SQL Server(版本:10.00.17763.01)和 SQL Server Native Client 11.0(版本:2011.110.7493.04)已经可用。
在我的笔记本电脑上执行 python 脚本时,我收到以下错误消息。
pyodbc.operationalError: ('08001', '[08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]SSL Security error (18) (SQLDriverConnect); [08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECDoClientHandshake()). (772)')
根据组织标准,TLS 1.0 在网络中安装了 SQL 服务器的 windows 服务器上被禁用。由于我是通过 python 脚本访问数据库,我们暂时无法启用 TLS 1.0。我在寻找一个方向。非常感谢任何帮助!!
Gord Thompson 在评论中指出了 Guna 的正确方向:
Can you try using ODBC Driver 17 for SQL Server and see if that works for you?
– Gord Thompson
Guna 说这有效:
I was facing different set of errors. While adding the port number in addition to the server name, the problem got resolved. The ODBC Driver name also needs to be updated. conn=pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};' 'Server=DB_Instance,port;' 'Database=DB_Name;' 'UID=user_name;' 'PWD=password;' 'Trusted_Connection=no;');
– Guna
将此作为社区 Wiki 发布只是为了让任何搜索者都能快速看到它已得到解答。
我正在尝试使用 pyodbc 从我的笔记本电脑(在 Windows 10 上)通过以下 python 脚本连接到我在 MS SQL Server 2016 上的数据库,并计划将代码部署在 Linux RHEL 6.4 服务器中。
conn=pyodbc.connect('Driver={SQL Server};'
'Server=DB_Instance;'
'Database=DB_Name;'
'UID=user_name;'
'PWD=password;'
'Trusted_Connection=no;');
在我的笔记本电脑上,SQL Server(版本:10.00.17763.01)和 SQL Server Native Client 11.0(版本:2011.110.7493.04)已经可用。
在我的笔记本电脑上执行 python 脚本时,我收到以下错误消息。
pyodbc.operationalError: ('08001', '[08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]SSL Security error (18) (SQLDriverConnect); [08001] [Microsoft] [ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (SECDoClientHandshake()). (772)')
根据组织标准,TLS 1.0 在网络中安装了 SQL 服务器的 windows 服务器上被禁用。由于我是通过 python 脚本访问数据库,我们暂时无法启用 TLS 1.0。我在寻找一个方向。非常感谢任何帮助!!
Gord Thompson 在评论中指出了 Guna 的正确方向:
Can you try using ODBC Driver 17 for SQL Server and see if that works for you?
– Gord Thompson
Guna 说这有效:
I was facing different set of errors. While adding the port number in addition to the server name, the problem got resolved. The ODBC Driver name also needs to be updated. conn=pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};' 'Server=DB_Instance,port;' 'Database=DB_Name;' 'UID=user_name;' 'PWD=password;' 'Trusted_Connection=no;');
– Guna
将此作为社区 Wiki 发布只是为了让任何搜索者都能快速看到它已得到解答。