错误 18456。状态 6“正在尝试将 NT 帐户名用于 SQL Server 身份验证。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2964097/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 06:26:37  来源:igfitidea点击:

Error 18456. State 6 "Attempting to use an NT account name with SQL Server Authentication."

sqlsql-server

提问by Aragorn

2010-05-06 17:21:22.30 Logon Error: 18456, Severity: 14, State: 6. 2010-05-06 17:21:22.30 Logon Login failed for user . Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: ]

2010-05-06 17:21:22.30 登录错误:18456,严重性:14,状态:6。2010-05-06 17:21:22.30 用户登录失败。原因:试图在 SQL Server 身份验证中使用 NT 帐户名。[客户: ]

The authentication mode is "Mixed". And it's MS SQL Server 2008.

认证模式为“混合”。它是 MS SQL Server 2008。

What might be the issue? Do you think the user name was not configured properly?

可能是什么问题?您是否认为用户名配置不正确?

Is there any link available for giving the right privileges and configuring the user account? So that I can check the rights and privileges for the acc I am using...

是否有任何链接可用于授予正确的权限和配置用户帐户?这样我就可以检查我正在使用的 acc 的权利和特权...

回答by Hyman Knows Hyman

Are you trying to use the SQL Server login mode with an NT name/password? Not allowed. SQL Server security logins only, in the SQL Server login mode.

您是否尝试使用带有 NT 名称/密码的 SQL Server 登录模式?不允许。仅限 SQL Server 安全登录,在 SQL Server 登录模式下。

Use the Windows login mode (it does not allow any password, and must be the current windows user).

使用Windows登录方式(不允许任何密码,必须是当前windows用户)。

Otherwise, create the NT user as a login for security & database rights in SQL Server.

否则,创建 NT 用户作为 SQL Server 中安全和数据库权限的登录名。

If you are trying to do a Windows login with a different user name, you have to impersonate or run the program as that user. SQL Server has no ability to use Windows logins other than the current user.

如果您尝试使用不同的用户名进行 Windows 登录,则必须以该用户身份模拟或运行该程序。SQL Server 无法使用当前用户以外的 Windows 登录名。

回答by Thomas Rushton

This problem is down to you passing NT / Windows account information in an application that expects you to be using SQL Server authentication.

此问题归结于您在希望您使用 SQL Server 身份验证的应用程序中传递 NT/Windows 帐户信息。

Is it an in-house application or a third party application? How are you telling it what user ID to use?

它是内部应用程序还是第三方应用程序?你如何告诉它使用什么用户 ID?

For example, SQLCMD has two ways of connecting - either submit a userID & password (switches -U and -P respectively), in which case it uses SQL authentication, or tell it to use Trusted authentication (switch -E) in which case it passes over your windows login credentials.

例如,SQLCMD 有两种连接方式 - 提交用户 ID 和密码(分别使用开关 -U 和 -P),在这种情况下它使用 SQL 身份验证,或者告诉它使用可信身份验证(开关 -E)在这种情况下它传递您的 Windows 登录凭据。

To generate the equivalent error with SQLCMD, you would run SQLCMD -S -U -P .

要使用 SQLCMD 生成等效错误,您可以运行 SQLCMD -S -U -P 。

If it's an in-house application, check the Connection String, and have a look at http://www.connectionstrings.comfor further information.

如果是内部应用程序,请检查连接字符串,并查看http://www.connectionstrings.com以获取更多信息。

If it's a third party application, then if it uses an ODBC DSN, then have a look at the settings for that and make sure it works stand-alone (there's a helpful "Test Connection" button). Or have a look for the database connection information in the applications config files / registry settings / whatever. Otherwise check the manual!

如果它是第三方应用程序,那么如果它使用 ODBC DSN,那么查看它的设置并确保它独立工作(有一个有用的“测试连接”按钮)。或者在应用程序配置文件/注册表设置/任何内容中查找数据库连接信息。否则检查手册!