SQL Server 2008R2 附件數據庫問題記錄

在Sql Server 2008 R2裏附加數據庫時彈出xxx.mdf拒絕訪問的錯誤數據庫

詳細錯誤信息以下:blog

TITLE: Microsoft SQL Server Management Studio
------------------------------io

Attach database failed for Server 'DESKTOP-QVD8O8E\SQLEXPRESS'. (Microsoft.SqlServer.Smo)cli

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476file

------------------------------
ADDITIONAL INFORMATION:exception

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)權限

------------------------------方法

Unable to open the physical file "E:\DataBases\AdventureWorks2008R2_Database\AdventureWorks2008R2_Data.mdf". Operating system error 5: "5(拒絕訪問。)". (Microsoft SQL Server, Error: 5120)im

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476error

------------------------------
BUTTONS:

OK
------------------------------

解決方法:

將存放xxx.mdf的文件的上一層目錄的權限加上Everyone角色並勾上「徹底控制」保存便可解決

相關文章
相關標籤/搜索