The target principal name is incorrect. Cannot generate SSPI context(目标主体名称不正确.无法生成 SSPI 上下文)
问题描述
我正在努力获得从机器 A 到运行 SQL Server 的机器 B 的 SQL Server 连接.
I am struggling to get a SQL Server connection from machine A to machine B which is running the SQL Server.
我在谷歌上进行了广泛的搜索,但我发现的所有东西都没有奏效.它们也不会引导您逐步完成解决此问题的过程.
I have Googled extensively and all the things I have found have not worked. Nor do they lead you step by step through the process of solving this.
我们使用的不是 Kerberos,而是配置的 NTLM.
We are not using Kerberos, but NTLM where configured.
所涉及的机器是(xx为了安全起见,用来掩盖一些机器名称):
The machines involved are (xx is used to obscure some of the machine name for security purposes):
- xxPRODSVR001 - Windows Server 2012 域控制器
- xxDEVSVR003 - Windows Server 2012(这台机器产生错误)
- xxDEVSVR002 - Windows Server 2012(这台机器运行的是 SQL Server 2012)
- xxPRODSVR001 - Windows Server 2012 Domain Controller
- xxDEVSVR003 - Windows Server 2012 (This machine is generating the error)
- xxDEVSVR002 - Windows Server 2012 (This machine is running SQL Server 2012)
以下 SPN 已在 DC (xxPRODSVR001) 上注册.出于安全目的,我用 yyy 隐藏了域:
The following SPN's are registered on the DC (xxPRODSVR001). I have obscured the domain with yyy for security purposes:
CN=xxDEVSVR002,CN=Computers,DC=yyy,DC=local 的注册 ServicePrincipalNames:
Registered ServicePrincipalNames for CN=xxDEVSVR002,CN=Computers,DC=yyy,DC=local:
MSSQLSvc/xxDEVSVR002.yyy.local:49298
MSSQLSvc/xxDEVSVR002.yyy.local:TFS
RestrictedKrbHost/xxDEVSVR002
RestrictedKrbHost/xxDEVSVR002.yyy.local
Hyper-V Replica Service/xxDEVSVR002
Hyper-V Replica Service/xxDEVSVR002.yyy.local
Microsoft Virtual System Migration Service/xxDEVSVR002
Microsoft Virtual System Migration Service/xxDEVSVR002.yyy.local
Microsoft Virtual Console Service/xxDEVSVR002
Microsoft Virtual Console Service/xxDEVSVR002.yyy.local
SMTPSVC/xxDEVSVR002
SMTPSVC/xxDEVSVR002.yyy.local
WSMAN/xxDEVSVR002
WSMAN/xxDEVSVR002.yyy.local
Dfsr-12F9A27C-BF97-4787-9364-D31B6C55EB04/xxDEVSVR002.yyy.local
TERMSRV/xxDEVSVR002
TERMSRV/xxDEVSVR002.yyy.local
HOST/xxDEVSVR002
HOST/xxDEVSVR002.yyy.local
CN=xxDEVSVR003,CN=Computers,DC=yyy,DC=local 的注册 ServicePrincipalNames:
Registered ServicePrincipalNames for CN=xxDEVSVR003,CN=Computers,DC=yyy,DC=local:
MSSQLSvc/xxDEVSVR003.yyy.local:1433
MSSQLSvc/xxDEVSVR003.yyy.local
Hyper-V Replica Service/xxDEVSVR003
Hyper-V Replica Service/xxDEVSVR003.yyy.local
Microsoft Virtual System Migration Service/xxDEVSVR003
Microsoft Virtual System Migration Service/xxDEVSVR003.yyy.local
Microsoft Virtual Console Service/xxDEVSVR003
Microsoft Virtual Console Service/xxDEVSVR003.yyy.local
WSMAN/xxDEVSVR003
WSMAN/xxDEVSVR003.yyy.local
TERMSRV/xxDEVSVR003
TERMSRV/xxDEVSVR003.yyy.local
RestrictedKrbHost/xxDEVSVR003
HOST/xxDEVSVR003
RestrictedKrbHost/xxDEVSVR003.yyy.local
HOST/xxDEVSVR003.yyy.local
现在,如果只有 SQL Server 错误消息更具描述性并告诉我它尝试连接的主体名称,我也许能够诊断出这一点.
Now if only the SQL Server error message was more descriptive and told me what principal name it was trying to connect to I might be able to diagnose this.
那么任何人都可以指导我如何解决这个问题,或者你能看到我提供的任何东西是错误的吗?
So can anyone step me through how to solve this one or can you see anything in what I have provided that is wrong?
我很乐意生成更多调试信息,只需告诉我您需要什么.
I would be happy to generate more debug info, just tell me what you need.
推荐答案
我在使用 ASP.NET MVC 应用时遇到了这个问题.
I had this problem with an ASP.NET MVC app I was working on.
我意识到我最近更改了密码,我可以通过注销并重新登录来修复它.
I realized I had recently changed my password, and I was able to fix it by logging out and logging back in again.
这篇关于目标主体名称不正确.无法生成 SSPI 上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:目标主体名称不正确.无法生成 SSPI 上下文
基础教程推荐
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01