I am getting this error while trying to connect to the SQL Server.
Microsoft SQL Server Error: 18456
Can anybody tell me what th
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 ....
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.
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
For me, it was wrong login and password.
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.