This article is a mirror article of machine translation, please click here to jump to the original article.

View: 16422|Reply: 0

[Source] Unable to open physical file C:\Databases\xxx.mdf. OS error 5: "5 (Access denied. )

[Copy link]
Posted on 9/7/2016 2:11:21 PM | | |
Title: Microsoft SQL Server Management Studio
------------------------------

Attached database fails for server "xxx".  (Microsoft.SqlServer.Smo)

For help information, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1322+)&EvtSrc= Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attached Database+Server&LinkId=20476

------------------------------
Additional information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Unable to open physical file "C:\Databases\xxx.mdf". OS error 5: "5 (Access denied. )”。 (Microsoft SQL Server, Error: 5120)

For help information, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

------------------------------
Button:

Are you sure
------------------------------



When attaching a database with T-SQL commands, the following abnormal message appears:

Unable to open physical files XXX.mdf". OS error 5: "5 (Access denied. )"。 (Microsoft SQL Server, Error: 5120)  

Solution:

Found itxxx.MDF and xxx_log. LDFFile, right click - Properties - Security - Add Authenticated Users at the group or username - Change the group permission to full permission, attach again successfully.





Previous:linq/ef framework Lambda expression where query for today's date
Next:VS2013 Key – All versions
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com