One of the most common and searched SQL Server failure is around “Logins”. Login failed for user has always been tricky and interesting to troubleshoot. I don’t think there is a silver bullet to easily troubleshoot the same. With every version of SQL Server, there are enhancements made in error reporting, which try to make life on DBA’s easy. In previous version of SQL, whenever there is a login failed, it would print message in the SQL ERRORLOG along with the state of login failed. It was difficult for a DBA to find the cause further and it all boiled down to doing a number of permutations and combinations of resolution over the internet. Let us see how to FIX Error 18456.
If you are new to SQL Server, then use below to find ERRORLOG
SQL SERVER – Where is ERRORLOG? Various Ways to Find its Location
Here is the message in ERRORLOG
Error: 18456, Severity: 14, State: 58.
Login failed for user ‘AppLogin’. Reason: An attempt to login using SQL authentication failed. The server is configured for Windows authentication only. [CLIENT: <local machine>]
Here was the connection string from the application:
“DRIVER={SQL Server Native Client 10.0};Server=BIGPINAL;Network Library=DBMSSOCN;Initial Catalog=myDB;User ID=AppLogin;Password=myPassword@123”
If you know SQL Server authentication modes, then it’s easy to fix. If you are new to SQL, then here are the steps
- Connect to SQL via SQL Server Management Studio.
- Right click on the server name on object explorer -> Properties -> Security -> Change Server authentication to “SQL server and Windows authentication mode” -> click OK.
- After that, open server at object explorer -> Expand security -> Expand Login -> right click on your login -> properties -> type new password -> confirm password -> OK.
In my case AppLogin was created. Else you may need to create the login.
Now disconnect your SQL and restart your system. After this your application should be able to login with the changed password in SQL authentication mode. This tough look simple, sometimes will be of great help. I hope this blog will surely land into someone’s web search someday. I seriously hope it helps you too.
Reference: Pinal Dave (https://blog.sqlauthority.com)
8 Comments. Leave new
Blogging the simple details even, is the best part of Pinal
“This tough look simple, sometimes will be of great help. I hope this blog will surely land into someone’s web search someday. I seriously hope it helps you too.”
Nice work done with a nice thought.. It has helped a newbie like myself
Many thanks indeed, this fixed my problem nicely.
I am seeing this error a lot in my logs, but the db is already set up to use SQL and Windows authentication.
Anything else i can look at?
I am seeing this error a lot in my logs, but the server is already set to use Windows and SQL authentication. Anything else to look at?