SQL Server 2005 mixed mode authentication
Solution 1
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.
Be sure to restart the SQL Service after changing the authentication mode for the changes to take effect.
Solution 2
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
Funky
Updated on June 09, 2022Comments
-
Funky almost 2 years
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
-
Funky about 13 yearsI have done it this way and it doesn't work. It doesn't ask me during installation for which authentication mode to use ?
-
theChrisKent about 13 yearsYou've verified that the SERVER has been configured for Mixed Mode (as shown above in the first image) and that the sa login for the server has been enabled as shown in the second image? You will also need to restart the SQL service for the changes to authentication mode to go into effect.
-
Glenn Lawrence over 8 yearsI'm using SQL Express 2005 but I have no
MSSQL.1
branch in HKLM\Software\Microsoft\Microsoft SQL Server\ just90
andSSMEE