Cannot create SSPI context

前端 未结 19 1350
北海茫月
北海茫月 2020-12-28 13:13

I am working on a .NET application where I am trying to build the database scripts. While building the project, I am getting an error \"Cannot create SSPI context.\". This e

相关标签:
19条回答
  • 2020-12-28 13:35

    I had the same issue after changing the user which was running the MSSQLSERVER-Service

    To solve incorrect SPNs with SQL Server I used this tool

    http://www.microsoft.com/en-us/download/details.aspx?id=39046 - Microsoft® Kerberos Configuration Manager for SQL Server

    In my case it worked pretty well.

    0 讨论(0)
  • 2020-12-28 13:36

    This error usually comes when the Windows user account is expired and he is already logged in with old password. Just ask the user to restart his machine and check if the password is expired or he has changed the password. Hope this helps!!!!!

    0 讨论(0)
  • 2020-12-28 13:38

    If you are hosting on IIS, make sure the password for the AppPool account has not changed.

    If it has, then follow these steps:

    • Go to IIS
    • Click on Application Pools
    • Select the AppPool of your application
    • Right Click on your AppPool
    • Advanced settings
    • Identity
    • Update Password
    • Restart AppPool
    0 讨论(0)
  • 2020-12-28 13:38

    Had a really weird instance of this; All the web products that had connection strings containing the windows computer name of the SQL server worked fine, but the products that had a FQDN with the internal domain attached gave an SSPI error. i.e. COMPUTERNAME vs COMPUTERNAME.DOMAIN (ping always worked as expected)

    This ONLY gave problems when a new SQL server was being used and hosts files pointed both the computer name and the computername as a FQDN for the connection strings.

    Solution in this case was to set all the connection strings to the computer name only, removing the domain references.

    SQL : 2008R2 SQL2012

    IIS : 2008R2

    0 讨论(0)
  • 2020-12-28 13:39

    I also issued this problem, and the server admins solved it by following the same solution as indu_teja proposed in http://www.sqlservercentral.com/Forums/Topic546566-146-1.aspx

    The solution proposed by indu_teja says :

    If you get this "SSPI Context Error". The issues we face are:

    1. We will not be able to connect to SQL Server remotely.
    2. However we will be able to connect to server with local account.

    CAUSE: The issue might be becasue of no proper sync happenign fro the SPNs in Active directory.

    RESOLUTION:

    1. You need to reset SPN. Use the synytax "SET SPN". You can check the syntax in net once.
    2. Change your sql server service account from domain account to Local account, recycle sql, and then reset again with your domain account and recycle sql server.
    0 讨论(0)
  • 2020-12-28 13:39

    Perhaps you have used Integrated Security = SSPI in connection string. SSPI is used for Trusted connections using Windows Authentication.hence, to work properly in windows authentication, either your system and database server should be in same domain and using same DNS server address, or should be in trusted domain.

    if your system and database server is in same domain, Check DNS server address of IPV4 properties in your system's network connection and provide same DNS server being used by database server.

    0 讨论(0)
提交回复
热议问题