我正在尝试使用sa"用户名及其密码连接到 SQL Server 2008.在 SQL Server 日志文件中,我看到此错误:
I am trying to connect to SQL Server 2008 using 'sa' username and its password. In the SQL Server log file I see this error:
用户sa"登录失败.原因:尝试使用 SQL 登录认证失败.服务器配置为 Windows 身份验证仅.
Login failed for user 'sa'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only.
当我右键单击服务器时 -> 属性 -> 安全性选择了SQL Server 和 Windows 身份验证模式".
我认为这是sa"用户的问题,所以我做了:
When I right-clicked on the server -> Properties -> Security "SQL Server and Windows authentication mode" is chosen.
I thought it's a problem with the 'sa' user so I did:
ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;
GO
但这没有帮助.
还能是什么?
But it didn't help.
What else can it be?
根据启用 混合模式身份验证
有另一篇文章(底部的用户评论)引用您可以查看的注册表项;它还说您需要在更改后重新启动服务.
There is another article (user comment at the bottom) referencing a registry key that you can look at; it also says you will need to restart the service once you have changed it.
来自第一个链接:
更改安全认证模式:
在 SQL Server Management Studio 对象资源管理器中,右键单击服务器,然后单击属性.
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.
在 SQL Server Management Studio 对话框中,单击确定"以确认重新启动 SQL Server 的要求.
In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
从 SQL Server Management Studio 重新启动 SQL Server
这篇关于尝试使用 SQL 身份验证登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!