且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-02-03 10:27:02

您需要添加

You need to add a server login:

  1. 使用sa的SSMS连接到SQL Server.
  2. 在SSMS的 Object Explorer 窗格中钻入服务器的 Security 文件夹.
  3. 右键单击出现在对象资源管理器中的服务器的安全> 登录文件夹.
  4. 在出现的上下文菜单中单击新登录... .
  5. 在打开的 Login-New 对话框中提供新登录的详细信息-尤其是其 General 服务器角色用户映射页面(沿左侧). (请参阅每页的屏幕截图,并在答案的底部输入示例.)
  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实例.将新的登录名映射到 数据库用户 (在登录-新建"对话框的"映射"页面中),如果您指定的用户名还不存在或者,您可以将新登录名映射到现有的数据库用户.

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.