“无法生成 SSPI 上下文”通过 Python 连接 MS SQL Server 时的问题
我正在尝试使用 python pyodbc 库连接数据库。我有以下错误:
pyodbc.Error: ('HY000', '[HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: The logon attempt failed\r\n (-2146893044) (SQLDriverConnect); [HY000
] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893044); [HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: The lo gon attempt failed\r\n (-2146893044); [HY000] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893044)')
我使用常规登录名/密码身份验证,并且通过 MS SQL Management Studio 连接时它在同一台计算机上工作。当我在不同的机器上使用相同的凭据运行相同的 Python 脚本时,它也可以正常工作
I'm trying to connect a database by using python pyodbc
library. And I have the following error:
pyodbc.Error: ('HY000', '[HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: The logon attempt failed\r\n (-2146893044) (SQLDriverConnect); [HY000
] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893044); [HY000] [Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: The lo gon attempt failed\r\n (-2146893044); [HY000] [Microsoft][SQL Server Native Client 11.0]Cannot generate SSPI context (-2146893044)')
I'm using regular login/password authentcation and it works on the same machine when connecting by MS SQL Management Studio. And it also works fine when I run the same Python script with same credentials on different machine
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论