SQL Server Login failed for user after a couple hours

452 views Asked by At

I've been struggling with this problem for a while. When I tried to connect to my database I'm getting the error 18456: "Login failed for user ". I've checked all my settings and everything seems to be fine. If I access to the server via Windows Authentication there's no problem and I can reset the password of my user, and everything works again just for a couple hours and then I'm getting the same error again.

Do you know what the problem could be?

2

There are 2 answers

1
user7525112 On

The reason behind the error is hidden as to improve security. In an SQL server error log there should be an error state. If you go to this site there is a table with what your problem is. The info is here anyway:

state 2: User ID is not valid.

state 5: User ID is not valid.

state 6: An attempt was made to use a Windows login name with SQL Server Authentication.

state 7: Login is disabled, and the password is incorrect.

state 8: The password is incorrect.

state 9: Password is not valid.

state 11: Login is valid, but server access failed.

state 12: Login is valid login, but server access failed.

state 18: Password must be changed.

0
Joe Lau On

I faced the same situation and found the reason as missing "SQL Server authentication mode" enabled. Maybe you can try the answer in another post