目标主体名称不正确.无法生成SSPI上下文 [英] The target principal name is incorrect. Cannot generate SSPI context
问题描述
我正在努力获得从机器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.
我已经在Google上进行了广泛的搜索,发现的所有内容均无效.他们也不会带领您逐步解决此问题.
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 =计算机,DC = yyy,DC =本地的已注册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 =计算机,DC = yyy,DC =本地的已注册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上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!