无法登录到 SQL Server 2008 R2 Management Studio 中的服务器

Unable to log in to server in SQL Server 2008 R2 Management Studio(无法登录到 SQL Server 2008 R2 Management Studio 中的服务器)

本文介绍了无法登录到 SQL Server 2008 R2 Management Studio 中的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SQL Server 2008 R2 实例,可以使用 sa 用户登录.但是我想定义另一个用户(administrator)使用 SQL Server Management Studio 登录,所以我做了以下操作:

I have a SQL Server 2008 R2 instance and can log in using the sa user. But I want to define another user (administrator) to log in with SQL Server Management Studio, so I did the following:

  • 在 Management Studio 中以 sa 身份登录到服务器.
  • 右键单击数据库名称.
  • 点击了属性.
  • 然后在许可下,我选择所需的用户名(administrator).
  • 我授予他所有权限.
  • Logged in to the server in Management Studio as sa.
  • Right clicked on the database name.
  • Clicked on properties.
  • Then under permission, I select the required username (administrator).
  • And I grant him all the permission.

但是当我尝试使用 administrator 登录时,出现以下错误:

But when I tried to log in using administrator, I got the following error:

用户管理员"登录失败,错误 18456.

Login failed for user "administator" Error 18456.

谁能告诉我可能是什么问题?

Can anyone advise what might be the problem?

推荐答案

你需要添加一个服务器登录:

You need to add a server login:

  1. 使用 SSMS 作为 sa 连接到您的 SQL Server.
  2. 在 SSMS 的 Object Explorer 窗格中深入了解服务器的 Security 文件夹.
  3. 右键单击服务器的 Security > Logins 文件夹,该文件夹出现在 Object Explorer 中.
  4. 在出现的上下文菜单中单击 New Login....
  5. 在打开的登录 - 新建对话框中提供新登录的详细信息 - 特别是其常规服务器角色用户映射 页面(沿左侧).(请参阅每个页面的屏幕截图以及答案底部的示例输入.)
  1. Connect to your SQL Server with SSMS as sa.
  2. Drill into the server's Security folder in SSMS's Object Explorer pane.
  3. Right-click on the server's Security > Logins folder that appears in Object Explorer.
  4. Click on New Login... in the context menu that appears.
  5. Provide details of the new login in the Login - New dialog that opens - particularly its General, Server Roles, and User Mappings pages (along the left). (See the screenshots of each page with sample input at the bottom of the answer.)

您可能需要根据需要添加数据库用户,但需要服务器登录(如您的 sa 登录)才能使用 Windows 或 SQL Server 身份验证连接到 SQL Server 实例.将新登录名映射到 数据库用户(在 Login - New 对话框的 User Mappings 页面中)将在映射数据库中创建新用户尚不存在;或者,您可以将新登录名映射到现有数据库用户.

You may need to add a database user depending on your needs, but a server login (like your sa login) is necessary to connect to the SQL Server instance using Windows or SQL Server authentication. Mapping the new login to a database user (in the Login - New dialog's User Mappings page) will create a new user in the mapped database if you specify a username that does not already exist; alternatively you can map the new login to an existing database user.

另一个 SO 问题谈到了服务器登录和数据库用户之间的区别.

Another SO question speaks to the differences between server logins and database users.

这篇关于无法登录到 SQL Server 2008 R2 Management Studio 中的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:无法登录到 SQL Server 2008 R2 Management Studio 中的服务器

基础教程推荐