Funky
Funky

Reputation: 13602

SQL Server 2005 mixed mode authentication

just wondering is it possible to use mixed mode on sql server 2005 for user sa? I know how to do this in management studio but this isn't enough for user "sa". I think it needs done else where.

I am trying to connect to the database via a console app but keep getting the error "The account is disabled"

Cheers

Louis

Upvotes: 3

Views: 11741

Answers (3)

Greg Bray
Greg Bray

Reputation: 15697

If you are using SQL Express 2005 or you do not have SQL Server Management Studio installed you will need to update a registry key to enable Mixed Mode Authentication:

Open registry editor (launch application %WINDIR%\regedit.exe) and go to HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer in the tree on the left.

On the right, look for an entry named LoginMode. The default value, when installed is 1. Update it to 2. The next step is to restart the service.

Launch your Service Manager (Start -> Run -> Type services.msc) and look for a service named MSSQL Server (SQLEXPRESS). Restart the service.

Once the SQL Server service is restarted you then need to enable the sa account. Use the OSQL command line tool from an Administrator Command Prompt:

osql -E -S .\SQLEXPRESS
ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<password>' ;
GO

You should then be able to test the login using:

osql -U sa -S .\SQLEXPRESS

Upvotes: 7

theChrisKent
theChrisKent

Reputation: 15099

Yes

http://msdn.microsoft.com/en-us/library/ms144284(v=SQL.90).aspx

How to: http://msdn.microsoft.com/en-us/library/ms188670(v=SQL.90).aspx

If you didn't enable Mixed Mode Authentication during setup then you will need to do so in server properties > Security (you can use Management Studio - see above link). You will also need to enable the sa login and set an appropriate password.

Enable MixedMode

Enable sa

Be sure to restart the SQL Service after changing the authentication mode for the changes to take effect.

Upvotes: 7

Neil Knight
Neil Knight

Reputation: 48537

If you SQL Server is already configured for Mixed Mode Authentication, then you just need to enable the sa user. You can find it in the Security->Logins folder.

Upvotes: 0

Related Questions