尝试使用 SQL 身份验证登录失败

2023-10-10数据库问题
7

本文介绍了尝试使用 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 身份验证登录失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

按天分组的 SQL 查询
SQL query to group by day(按天分组的 SQL 查询)...
2024-04-16 数据库问题
77

在 Group By 查询中包含缺失的月份
Include missing months in Group By query(在 Group By 查询中包含缺失的月份)...
2024-04-16 数据库问题
12

sql group by 与不同
sql group by versus distinct(sql group by 与不同)...
2024-04-16 数据库问题
37

如何在SQL中返回每个组的增量组号
How to return a incremental group number per group in SQL(如何在SQL中返回每个组的增量组号)...
2024-04-16 数据库问题
8

统计分组返回的记录数
Count number of records returned by group by(统计分组返回的记录数)...
2024-04-16 数据库问题
10

带聚合函数的 SQL GROUP BY CASE 语句
SQL GROUP BY CASE statement with aggregate function(带聚合函数的 SQL GROUP BY CASE 语句)...
2024-04-16 数据库问题
23