Login to Microsoft SQL Server Error: 18456

前端 未结 21 2051
醉话见心
醉话见心 2020-11-27 10:11

I am getting this error while trying to connect to the SQL Server.

Microsoft SQL Server Error: 18456

Can anybody tell me what th

相关标签:
21条回答
  • 2020-11-27 10:43

    first see the details of the error if "state" is "1" Ensure the database is set for both SQL and Windows authentication under SQL server / Properties / Security.

    for other state see the above answers ....

    0 讨论(0)
  • 2020-11-27 10:46
    1. Check whether mixed mode authentication is enabled in you server->properties
    2. Then create a login in the server->security
    3. create an user for that login in your database
    4. Then restart your server by right clicking the instance and select restart
    0 讨论(0)
  • 2020-11-27 10:47

    In my case multiple wrong attempts locked the account.To do that I had tried running the below query and it worked: ALTER LOGIN WITH PASSWORD= UNLOCK And make sure to set the option "Enforce Password Security" option for specific user to be unchecked by right click on Sql Server -> Properties.

    0 讨论(0)
  • 2020-11-27 10:50

    Also you can just login with windows authentication and run the following query to enable it:

    ALTER LOGIN sa ENABLE ;  
    GO  
    ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;  
    GO
    

    Source: https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/change-server-authentication-mode

    0 讨论(0)
  • 2020-11-27 10:50

    For me, it was wrong login and password.

    0 讨论(0)
  • 2020-11-27 10:51

    I got this error after creating a new sysadmin user under my SQL instance. My admin user was created under a specific domain MyOrganization/useradmin

    Using useradmin on a disconnected environment allows you to create other users using SQL Server authentication, but as soon as you try to login you get

    Microsoft SQL Server Error: 18456

    To fix the problem, try to connect again to your Organization network and create the user while you are connected and then you can get disconnected and will work.

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