尝试使用SQL身份验证登录失败 [英] An attempt to login using SQL authentication failed

查看:267
本文介绍了尝试使用SQL身份验证登录失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用"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 Server代理正在运行,则还必须重新启动它.

这篇关于尝试使用SQL身份验证登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆