Monday, May 16, 2011

Cannot connect to SQLServer, with newly created login using SQL Server Authentication

Connection issue is one of the widely reported issue in SQL Server forums. Also an issue people who work with Databases come across very frequently.

In this post I am going to point out a solution for one of those instances. When you have created a new login with SQL Server Authentication and try to log in with it you get following error;

TITLE: Connect to Server
------------------------------
Cannot connect to SQLServer.
------------------------------
ADDITIONAL INFORMATION:
Login failed for user 'username'. (Microsoft SQL Server, Error: 18456)

This can sometimes freak you out, but solution is simple. As you may aware there are two types of authontication supported in SQL Server. One is Windows Authontication and the other one is SQL Server Authontication (which is the case here). In SQL Server configuration you have to enable mixed mode authontication in order to use SQL Server Authontication. This error is most of the cases pops up because you havent enable the mixed mode authontication for the server.

Here how we can do this, right click on the server instance name on the object explorer, go to security page, select SQL Server and Windows Authontication option under Server Authontication. In order to make these changes effective you have to restart the SQL Server service for your server instance.

No comments:

Post a Comment