Search code examples
sql-serversql-server-2008authentication

An attempt to login using SQL authentication failed


I am trying to connect to SQL Server 2008 using 'sa' username and its password. In the SQL Server log file I see this error:

Login failed for user 'sa'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.

When I right-clicked on the server -> Properties -> Security "SQL Server and Windows authentication mode" is chosen.
I thought it's a problem with the 'sa' user so I did:

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

But it didn't help.
What else can it be?


Solution

  • It looks like you will need to restart your SQL Server according to the MSDN link on enabling Mixed-Mode Authentication

    There is another article (user comment at the bottom) referencing a registry key that you can look at; it also says you will need to restart the service once you have changed it.

    From the first link:

    To change security authentication mode:

    • In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

    • On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

    • In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.

    To restart SQL Server from SQL Server Management Studio

    • In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.