Unable to open the physical file "D:\databasepc.mdf". Operating system error 5: "5(Access is denied.)".

  • OK, over kill service accounts shouldn't be added to the admin groups, but whats done is done.

    Please post screenshots of the error messages you are receiving, along with screenshots of the SQL Server Config Manager services screen and drive/folder/file permissions.

    If you're still getting error 5, some permission hasn't filtered through correctly.

  • Echoing Anthony's answer, do not add the service accounts to those groups, it is totally unnecessary! Open the location in Windows Explorer, right click on the folder, choose properties and open the security tab. From there you can set the appropriate permissions to the service account.

    😎

  • Make sure antivirus is not holding lock on the file, I remember seeing this alert when mdf files were not excluded from antivirus scans.

    If it is not the case, Use process monitor to see if any other process is having lock on that file

    https://technet.microsoft.com/en-us/sysinternals/bb896645/

  • Added the Administrators Group to the file security permissions with full control for the Data file (S:) and the Log File (T:).

    Attached the database

  • Don't forget to right-click the file and take ownership of it (as the account running SQL Server services).

    Last time I encountered what you encountered, an outside developer had created the original file in a folder that only his local user had permissions on. We had done exactly as you and checked locks, added permissions, moved to a folder with great permissions right off the root - Nothing.

    Once we got ownership of the file, we were able to move forward.

  • Raghavender (11/9/2015)


    Yes Even service accounts are added into admin group and we have given full control on the folder and files.

    adding an account to the local admins does not guarantee access to the files, it's possible to impede an admin, they just have the ability to take control and change ownership of files.

    Please post a screenshot of the settings on the security tab for the folder in question

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply