简体   繁体   English

如何使用 Python 和 Windows 身份验证从 WSL2 连接到非本地 MS SQL 服务器?

[英]How to connect to non-local MS SQL Server from WSL2 using Python and Windows Authentication?

I'm trying to connect to a MS SQL Server which is not running on my local machine.我正在尝试连接到不在我的本地计算机上运行的 MS SQL 服务器。 I'm using a python script developed on WSL2 with pyodbc, but I need to sign into the SQL server with Windows Authentication.我正在使用在 WSL2 上使用 pyodbc 开发的 python 脚本,但我需要使用 Windows 身份验证登录到 SQL 服务器。

Is there a way to achieve this?有没有办法做到这一点?

Windows Authentication means either NTLM or Kerberos. Windows 身份验证意味着 NTLM 或 Kerberos。 NTLM is not available for ODBC on Linux, so you must use Kerberos on MacOS or Linux . NTLM 不适用于 Linux 上的 ODBC,因此您必须在 MacOS 或 Linux 上使用 Kerberos

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM