0

按照许多教程中的建议,我在 SQL Server 2012 上进行了以下设置:

  • 我将服务器身份验证设置为“SQL Server 和 Windows 身份验证模式”
  • 我使用默认数据库“master”为 SA 用户设置了具有强制密码策略的强密码
  • 我授予 SA 用户连接数据库引擎的权限并启用他的登录。

然而,当我尝试通过 SQL Server 身份验证登录到“本地主机”时。

它失败了:

Cannot connect to (local).
------------------------------
Login failed for user 'sa'. (Microsoft SQL Server, Error: 18456)

我如何登录的唯一可能方法仍然是 Window 身份验证。

我的实例名为 MSSQLSERVER。localhost\MSSQLSERVER 不可访问。

4

1 回答 1

1

可能有多种原因。请检查您的错误日志并查找错误状态。根据状态,错误可能是 -

State Description
1     Error information is not available. This state usually means you do not have permission to receive the error details. Contact your SQL Server administrator for more information.
2     User ID is not valid.
5     User ID is not valid.
6     An attempt was made to use a Windows login name with SQL Server Authentication.
7     Login is disabled, and the password is incorrect.
8     The password is incorrect.
9     Password is not valid.
11    Login is valid, but server access failed. One possible cause of this error is when the Windows user has access to SQL Server as a member of the local administrators group, but Windows is not providing administrator credentials. To connect, start the connecting program using the Run as administrator option, and then add the Windows user to SQL Server as a specific login.
12    Login is valid login, but server access failed.
18    Password must be changed.

有关详细信息 - MSDN

于 2013-08-14T18:30:06.693 回答