A connection was successfully established with the server, but then an error occurred during the login process. (Error Number: 233)

后端 未结 14 1521
没有蜡笔的小新
没有蜡笔的小新 2020-12-05 13:03

I am having error while connecting to SQL Server:

Details in Stack Trace are:

===================================

Cannot connect to ServerN         


        
相关标签:
14条回答
  • 2020-12-05 13:10

    This is what helped me [src]:

    0 讨论(0)
  • 2020-12-05 13:13

    My problem resolved by this what changes i have done in .net core Do this changes in Appsetting.json

    Server=***;Database=***;Persist Security Info=False;User ID=***; Password=***;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=False;Connection Timeout=30
    

    and Do following changes in Package console manager

    Scaffold-DbContext "Server=***;Database=***;Persist Security Info=False;User ID=***; Password=***;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=False;Connection Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context DatabaseContext -f
    

    Happy coding

    0 讨论(0)
  • 2020-12-05 13:15

    I got that error message in code line containing SqlConnection.Open() running my .NET code as x64 application. Running as x86 causing no errors.

    Solution was to deactivate the Force protocol encryption option for TCP/IP in %windir%\System32\cliconfg.exe

    Force protocol encryption

    0 讨论(0)
  • 2020-12-05 13:15

    In my case I had the following by mistake in my connection string:

    Encrypt=True
    

    Changing to

    Encrypt=False
    

    Solved the problem

    "Server=***;Initial Catalog=***;Persist Security Info=False;User  ID=***;Password=***;MultipleActiveResultSets=False;Encrypt=False;TrustServerCertificate=False;Connection Timeout=30;"
    
    0 讨论(0)
  • 2020-12-05 13:16

    Turn out to be some SQL service was stopped somehow on server. Restarting SQL Server service manually was the solution.

    I know this is foolish but worked anyway. Thanks @PareshJ for the useful comment.

    0 讨论(0)
  • 2020-12-05 13:16

    From here:

    Root Cause: Maximum connection has been exceeded on your SQL Server Instance.

    How to fix it...!

    1. F8 or Object Explorer
    2. Right click on Instance --> Click Properties...
    3. Select "Connections" on "Select a page" area at left
    4. Chenge the value to 0 (Zero) for "Maximum number of concurrent connections(0 = Unlimited)"
    5. Restart the SQL Server Instance once.

    Apart from that also ensure that below are enabled:

    • Shared Memory protocol is enabled
    • Named Pipes protocol is enabled
    • TCP/IP is enabled
    0 讨论(0)
提交回复
热议问题