SQL Server 2008 无法采用SQL认证模式登录(已解决)

环境:Vista SP1,SQL 2008 Enterprise

目的:本机有2个登录帐户,一个是本机帐户a,一个是公司的域帐户domain\b。用本机帐户安装SQL 2008,安装时选择Windows认证模式,现在希望另外建立一个用户供公司域帐户登录windows时访问SQL使用。

症状:用本机帐户a为SQL Instance建立一个新的login,名叫sqllogin,选择其认证模式为SQL认证,然后用domain\b登录windows,再用sqllogin尝试登录SQL,出现如下错误信息:

初次登录错误信息:A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

之后再尝试错误信息: "login failed" (Error 18456)

解决:把SQL Instance的认证模式由安装时的windows认证模式改为混合模式,具体步骤如下:     

     参考:http://msdn.microsoft.com/en-us/library/ms188670.aspx

  1. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

  2. On the Security page, under Server authentication, select the new server authentication mode, and then click OK.

  3. In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.   

然后重启SQL Database Engine服务,重新建立login,即可。

如果不采用SQL认证,直接采用Windows身份验证,只需要将域帐户domain\b加入SQL Instance的login中即可。

原文地址:https://www.cnblogs.com/smwikipedia/p/1322821.html