无法登录到SQL Server + SQL Server验证+错误:18456(Unable to login to SQL Server + SQL Server Authentication +

编程入门 行业动态 更新时间:2024-10-25 19:26:50
无法登录到SQL Server + SQL Server验证+错误:18456(Unable to login to SQL Server + SQL Server Authentication + Error: 18456)

我在我的localhost \ sql2008服务器(例如User123)上创建了登录帐号

映射到数据库(默认)

SQL Server上的身份验证模式设置为(Windows和SQL)

但是,登录到SQL Server将失败并显示以下消息(对于User123)

注意:多次检查UserName / Password是否正确输入

错误详情:

用户“User123”(Net.SqlClient数据提供者)登录失败

服务器名称:localhost \ sql2008错误编号:18456严重级:14状态:1行号:65536

有任何帮助请。

I have created login account on my localhost\sql2008 Server (Eg. User123)

Mapped to Database (default)

Authentication Mode on SQL Server is set to both (Windows and SQL)

But login to SQL Server fails with following message (for User123)

Note: Have checked multiple time that UserName / Password are typed in correctly

Error Details:

Login failed for user 'User123' (Net.SqlClient Data Provider)

Server Name : localhost\sql2008 Error Number: 18456 Severity : 14 State : 1 Line Number : 65536

any help on this please.

最满意答案

默认登录失败的错误消息是由于登录凭据不匹配而导致服务器拒绝客户端用户连接。 您可以检查的第一个任务是查看该用户是否具有该SQL Server实例和相关数据库的相关权限,这很好。 显然,如果没有设置必要的准则,那么您需要通过授予该用户登录的相关权限来解决该问题。

如果该用户在数据库和服务器上具有相关授权,如果服务器遇到该登录的任何凭据问题,那么这将阻止在将该身份验证转回SQL Server时,客户端将收到以下错误消息:

Msg 18456, Level 14, State 1, Server <ServerName>, Line 1 Login failed for user '<Name>'

现在好了,通过查看错误信息,你觉得这是非描述性的,以了解级别和状态。 默认情况下,操作系统错误将显示“状态”为1,而不管身份验证登录的问题如何。 因此,为了进一步调查,您还需要查看相关的SQL Server实例错误日志,以获取有关严重性和此错误的状态的更多信息。 您可以在日志中查看相应的条目:

2007-05-17 00:12:00.34 Logon Error: 18456, Severity: 14, State: 8. or 2007-05-17 00:12:00.34 Logon Login failed for user '<user name>'.

如上所述,错误的严重性和状态列是找到问题来源的准确反映的关键。 上述错误号8为状态表示由于密码不匹配导致的认证失败。 在线图书:默认情况下,严重性低于19的用户定义消息不会发送到Microsoft Windows应用程序日志。 因此,严重性低于19的用户定义的消息不会触发SQL Server Agent警报。

SQL Server协议(Dev.team)项目经理Sung Lee概述了有关错误状态描述的更多信息:常见错误状态及其描述如下表所示:

ERROR STATE ERROR DESCRIPTION ------------------------------------------------------------------------------ 2 and 5 Invalid userid 6 Attempt to use a Windows login name with SQL Authentication 7 Login disabled and password mismatch 8 Password mismatch 9 Invalid password 11 and 12 Valid login but server access failure 13 SQL Server service paused 18 Change password required Well I'm not finished yet, what would you do in case of error: 2007-05-17 00:12:00.34 Logon Login failed for user '<user name>'.

您可以看到没有从该SQL Server实例的错误日志定义的严重性或状态级别。 所以下一个故障排除选项是查看事件查看器的安全日志[编辑,因为屏幕截图丢失,但你得到了

想法,看事件日志中有趣的事件]。

By default login failed error message is nothing but a client user connection has been refused by the server due to mismatch of login credentials. First task you might check is to see whether that user has relevant privileges on that SQL Server instance and relevant database too, thats good. Obviously if the necessary prvileges are not been set then you need to fix that issue by granting relevant privileges for that user login.

Althought if that user has relevant grants on database & server if the Server encounters any credential issues for that login then it will prevent in granting the authentication back to SQL Server, the client will get the following error message:

Msg 18456, Level 14, State 1, Server <ServerName>, Line 1 Login failed for user '<Name>'

Ok now what, by looking at the error message you feel like this is non-descriptive to understand the Level & state. By default the Operating System error will show 'State' as 1 regardless of nature of the issues in authenticating the login. So to investigate further you need to look at relevant SQL Server instance error log too for more information on Severity & state of this error. You might look into a corresponding entry in log as:

2007-05-17 00:12:00.34 Logon Error: 18456, Severity: 14, State: 8. or 2007-05-17 00:12:00.34 Logon Login failed for user '<user name>'.

As defined above the Severity & State columns on the error are key to find the accurate reflection for the source of the problem. On the above error number 8 for state indicates authentication failure due to password mismatch. Books online refers: By default, user-defined messages of severity lower than 19 are not sent to the Microsoft Windows application log when they occur. User-defined messages of severity lower than 19 therefore do not trigger SQL Server Agent alerts.

Sung Lee, Program Manager in SQL Server Protocols (Dev.team) has outlined further information on Error state description:The common error states and their descriptions are provided in the following table:

ERROR STATE ERROR DESCRIPTION ------------------------------------------------------------------------------ 2 and 5 Invalid userid 6 Attempt to use a Windows login name with SQL Authentication 7 Login disabled and password mismatch 8 Password mismatch 9 Invalid password 11 and 12 Valid login but server access failure 13 SQL Server service paused 18 Change password required Well I'm not finished yet, what would you do in case of error: 2007-05-17 00:12:00.34 Logon Login failed for user '<user name>'.

You can see there is no severity or state level defined from that SQL Server instance's error log. So the next troubleshooting option is to look at the Event Viewer's security log [edit because screen shot is missing but you get the

idea, look in the event log for interesting events].

更多推荐

本文发布于:2023-07-16 07:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1125520.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   SQL   Server   Authentication   Error

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!