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

后端 未结 7 1066
时光取名叫无心
时光取名叫无心 2020-11-27 14:25

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

7条回答
  •  青春惊慌失措
    2020-11-27 14:46

    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 = '' ;
    GO
    

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

提交回复
热议问题