我的SQL Server 2005中无法访问数据库 [英] database not accessible in my sql server 2005

查看:135
本文介绍了我的SQL Server 2005中无法访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我的数据库运行良好,但是现在每次尝试打开数据库时都会出现错误.
错误是:

My database was running perfectly a few days ago but now I am getting an error whenever I try to open my database.
The error is:

The database first is not accessible. (ObjectExplorer)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.DatabaseNavigableItem.GetChildren()
   at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.SummaryView.get_Items()
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.ListViewVirtualStorage.CopyItems(ISummaryView summaryView)
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.ListViewVirtualStorage..ctor(ISummaryView summaryView, List`1 columnDescriptors)
   at Microsoft.SqlServer.Management.UI.VSIntegration.AppIDPackage.RightPaneListViewer.PopulateView()

推荐答案

1.以无法访问相关数据库的用户身份登录SSMS.
2.右键单击无法访问的数据库
3.点击属性"

如果您看到错误消息,表明服务器主体"无权访问该数据库,请重新登录为"sa",然后将该服务器主体"访问权授予该数据库(登录- > {username}-> Properties-> User Mapping).

这应该为正在收到无法访问"消息的用户打开有问题的数据库.
1. Log into SSMS as the user for whom the DB in question isn''t accessible.
2. Right-click on the inaccessible DB
3. Click ''Properties''

If you see an error message indicating that a ''Server Principal'' does not have access to the DB, re-login as ''sa'' and give that ''Server Principal'' access to the DB in question ( Logins->{username}->Properties->User Mapping ).

This should open up the DB in question for the user who is getting the ''inaccessible'' message.


对我有用的是:

右键单击Sql Server管理系统,然后单击属性.

单击安全性,您将看到管理员列表.

选择具有最大权限的管理员,然后单击确定".

你去! :)
What worked for me was as follows:

Right click the Sql Server Management System and click on properties.

Click on Security ,you''ll see list of administrators.

Choose admin with maximum rights, click OK.

There you go! :)


这篇关于我的SQL Server 2005中无法访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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