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角色并勾上“彻底控制”保存便可解决

相关文章
相关标签/搜索