Can't connect to SQL Server using 'sa' account, what I'm missing?

Solution 1:

Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:

  1. Login to the MSSQL Server Management Studio with Windows Authentication.
  2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.
  3. Under the Server Properties, select a page of "Security".
  4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok. MSSQL Server Management Database properties
  5. Restart the SQL Services and then try to login with 'sa' details.

Source: http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/

Solution 2:

Ok, I've been able to figure out what was happening (kind of) and got a workaround.

It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).

Anyway, I connected using Windows authentication (-E switch) and run the following query:

ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
GO
ALTER LOGIN [sa] ENABLE
GO

The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.

Thanks for all your suggestions.


Solution 3:

Things to check

Password on SA account

Mixed mode enabled

Is the SA account disabled?

Create another SQL account and try it (since you can get in with -E you dhould be able to do this)

Test using an ODBC connection, you can create this connection to see if the SA works

Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)

Tags:

Sql Server