如何不使用Management Studio启用SQL Server Express混合认证模式

SQL Server Express默认是不安装Management Studio的,如果在部署应用程序的时候,需要开启SQL Server Express的远程连接,又不想用户干涉,则需要编程修改如下位置的的注册表的值:

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 (http://support.microsoft.com/kb/322756/ ) How to back up and restore the registry in Windows

If you are not sure how to verify the authentication mode of your MSDE installation, you can check the corresponding registry entry. By default, the value of the Windows LoginMode registry subkey is set to 1 for Windows Authentication. When Mixed Mode authentication is enabled, this value is a 2.

  • The location of the LoginMode subkey depends on whether you installed MSDE as the default MSDE instance or as a named instance. If you installed MSDE as the default instance, the LoginMode subkey is located in the following registry subkey:

    HKLM\Software\Microsoft\MSSqlserver\MSSqlServer\LoginMode
    Note If you are using SQL Server 2005, whatever you installed a default instance or a named instance, locate the following registry subkey. MSSQL.x is a placeholder for the corresponding value for your system:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.x\MSSQLServer

  • If you installed MSDE as a named instance, the LoginMode subkey is located in the following registry subkey:

    HKLM\Software\Microsoft\Microsoft SQL Server\%InstanceName%\MSSQLServer\LoginMode

  • Note Before you switch authentication modes, you must set a sa password to avoid exposing a potential security hole.
    To switch from Mixed Mode to Integrated (Windows) authentication, follow these steps:

    1. To stop MSSQLSERVER and all other related services (such as SQLSERVERAgent), open the Services applet in Control Panel.
    2. Open the Registry Editor. To open the Registry Editor, click Start, click Run, and then type: "regedt32" (without the quotation marks)
      Click OK.
    3. Locate either of the following subkeys (depending on whether you installed MSDE as the default MSDE instance or as a named instance:

      HKEY_LOCAL_MACHINE\Software\Microsoft\MSSqlserver\MSSqlServer

      or

      HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\<Instance Name>\MSSQLServer\

    4. In the right-pane, double-click the LoginMode subkey.
    5. In the DWORD Editor dialog box, set the value of this subkey to 1. Make sure that the Hex option is selected, and then click OK.
    6. Restart the MSSQLSERVER and the SQLSERVERAgent services for this change to take effect.

转载于:https://www.cnblogs.com/yinzixin/archive/2009/06/16/1504322.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值