How can I change from SQL Server Windows mode to mixed mode (SQL Server 2008)?

Sql Server

Sql Server Problem Overview


I have installed SQL Server 2008 Express Edition, but by mistake I kept the Windows authentication mode.

Now I want to change that to SQL Server mixed mode. How can I do this?

Sql Server Solutions


Solution 1 - Sql Server

You can do it with SQL Management Studio -

> Server Properties - Security - [Server Authentication section] you check Sql > Server and Windows authentication mode

Here is the msdn source - http://msdn.microsoft.com/en-us/library/ms188670.aspx

Solution 2 - Sql Server

I had no success with other attempts on a SQL Server 2012. What I did was use SQL Server Management Studio to generate a script to change the value, and got this:

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO

After that, I enabled the sa account using this:

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

...then, I restarted the service, and everything worked!

Solution 3 - Sql Server

From this: http://weblogs.sqlteam.com/peterl/archive/2008/06/19/How-to-change-authentication-mode-in-SQL-Server.aspx

One can catch that you may change it through windows registry key

(SQLEXPRESS instance):

"Software\Microsoft\Microsoft SQL Server\SQLEXPRESS\LoginMode" = 2

... and restart service

Solution 4 - Sql Server

  1. Open up SQL Server Management Studio and connect to your database server.
  2. Right Click The Database Server and click Properties.
  3. Set the Server Authentication to SQL Server and Windows Authentication Mode.

Solution 5 - Sql Server

From MSDN:

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. > > In Object Explorer, right-click your server, and then click Restart. > If SQL Server Agent is running, it must also be restarted.

To enable the SA login:

> In Object Explorer, expand Security, expand Logins, right-click SA, > and then click Properties. > > On the General page, you might have to create and confirm a password > for the login. > > On the Status page, in the Login section, click Enabled, and then > click OK.

Solution 6 - Sql Server

Open the registry and search for key LoginMode under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

Update the LoginMode value as 2.

Solution 7 - Sql Server

If the problem is that you don't have access to SQL Server and now you are using mixed mode to enable sa or grant an account admin privileges, then it is far easier just to uninstall SQL Server and reinstall.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionpriyanka.sarkarView Question on Stackoverflow
Solution 1 - Sql ServerSvetlozar AngelovView Answer on Stackoverflow
Solution 2 - Sql ServerPablo MontillaView Answer on Stackoverflow
Solution 3 - Sql ServerLaurent de LAPRADEView Answer on Stackoverflow
Solution 4 - Sql ServerJason PunyonView Answer on Stackoverflow
Solution 5 - Sql ServerNarayanView Answer on Stackoverflow
Solution 6 - Sql ServerBMGView Answer on Stackoverflow
Solution 7 - Sql ServerUnderverseView Answer on Stackoverflow