如何使SQL Server查找与提供的名称匹配的登录名? [英] How to make SQL Server find a login matching the name provided?

查看:691
本文介绍了如何使SQL Server查找与提供的名称匹配的登录名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将数据库备份还原到我的本地SQL Server Express实例.

I have just restored a database backup to my local SQL Server express instance.

  1. 在服务器实例节点下的Management Studio中,我去了:安全->登录->新登录...
  2. 然后,我填写了登录名,密码并选择了SQL Server身份验证.在底部,我选择了新恢复的数据库作为默认数据库.
  3. 在左侧的用户映射"选项卡上,我将用户映射到新还原的数据库,并将其赋予"db_owner"角色.

当我尝试登录时,日志中出现以下错误:

When I try to login the following error is given in the log:

用户用户名"的登录失败.原因:找不到与提供的名称匹配的登录名. [客户:]

Login failed for user 'username'. Reason: Could not find a login matching the name provided. [CLIENT: ]

如何使SQL Server查找与我提供的名称匹配的登录名?

其他信息:

  • 已启用命名管道
  • 已启用TCP/IP
  • 允许远程连接

推荐答案

请确保已为从以下位置创建的用户选择了"SQL Server身份验证"模式 服务器>安全性>登录选项.

Please make sure you have selected "SQL Server Authentication" mode for user you created from Server > Security > Logins option.

另一种可能性是,您使用Management Studio创建了SQL Server登录名,并且选中了要求用户在首次登录时更改密码的选项.如果您没有立即登录Management Studio并更改密码,则尝试从另一台计算机登录的尝试将无法弹出对话框来更改密码,因此失败.

Another possibility, is that you created the SQL Server login using Management Studio, and the option requiring the user to change the password on first login was checked. If you didn't immediately login with Management Studio, and change the password, then the attempt to login from the other machine is not able to pop up a dialog box to change the password and so it fails.

尝试删除用户并重新创建.

try it by removing user and create again.

这篇关于如何使SQL Server查找与提供的名称匹配的登录名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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