Cannot Open Backup Device Operating System Error 5(Access is Denied)

Sometimes when you backup your SQL Server using SQLBackupAndFTP, SSMS or T-SQL Commands you can face the following issue Cannot Open Backup Device Operating System Error 5(Access is Denied). This has to be the most famous issue in taking SQL Server database backups. There are several reasons for this error and there are various ways to solve it. Some time ago we met this issue and for a time we were creating a backup and discovered a very helpful resolution to the issue. The issue was as described beneath:

Msg 3201, Level 16, State 1, Line 4
Cannot open backup device 'D:\Adventureworks.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 4
BACKUP DATABASE is terminating abnormally.

Cannot Open Backup Device Operating System Error 5(Access is Denied)

  • That error might appear when you try to backup the SQL Server database to a network drive.
  • Therefore, this problem message usually occurs as a result of mistaken permissions to the network drive.
  • Also, this issue can occur when there’s no directory with Log or there is not enough space on your drive.

How to Fix Cannot Open Backup Device Operating System Error 5(Access is Denied)

If you get that error usingĀ SQLBackupAndFTP try to specify a temporary folder for the backup job like C:\Temp and check if it fixes the issue.

If it still throws the same error, or you get this issue using SQL Server Management Studio please check NTFS permissions for the folder you have specified and make sure if all users of your system have all permissions to it.

To avoid the issues related to NTFS permissions we recommend you don’t use a folder in your profile folder like C:\Users\….

Another but the more rare reason for which this issue may arise is that a backup file with the same name already exists in the folder and it’s Read-Only. To fix it just right-click on it then choose “Properties”, uncheck Read-Only, and press “Apply” to save all-new settings.

If “Read-Only” is unchecked but you stillĀ have this issue go to the “Security” and give all necessary permission to the user.

After all necessary configurations are done you will be able to perform SQL Server database backup successfully.

Cannot Open Backup Device Operating System Error 5(Access is Denied)

34 thoughts on “Cannot Open Backup Device Operating System Error 5(Access is Denied)

  1. I fixed my problem on a Windows 2008 R2 backing up directly from the Sharepoint 2010 Foundations Central Administration, by allowing full access to Authenticated Users on the shared permissions of the backup folder.

  2. This did not solve my problem. I was finally able to solve this by following the below steps
    1. Navigate to Start/Services
    2. Look for the service SQL Server (MSSQLServer) and see the username under ‘Log On As’
    3. Add this user to have full control of permissions on the directory of back up by navigating to the folder / properties/ under secirity tab / Edit and give the same username and click on Check and Ad by giving full control.
    4. Save
    Now running the query of backup created the file.

    1. This user doesn’t exist when setting properties on the folder (how to type it in so it finds it?)
      NT Service\MSSQL$SQLEXPRESS

  3. i had the same issue when taking a backup on a shared location outside the server.
    I added permission of network and network service on that folder and it worked for me incase anyone else had the same issue.

    1. Shoab, that worked for me too. Actually several times on several systems. It must be something in the installation of the SQL of the program we use that requires it. And it is actually just the permissions of network services that fixes it for us.

  4. Great!!! Worked for me allowing full access to Authenticated Users on the shared permissions of the backup folder.

    Windows 2008 R2

  5. A small note:
    You can also get this problem if you haven’t written the name of the backup file and its extension in the path string. For example:
    BACKUP DATABASE DatabaseName
    TO DISK = ‘C:/Users/Username/Documents/DatabaseNameBackup.bak’

  6. Authenticated User worked for me as well. Thanks a bunch.
    What I found confusing is that I have a folder that uses the SQLEngine and SQLAgent for permissions, which works without issues. When I created another folder for a lesson, it would not use the two new users I created, even though these two other users. SQLEngine1 and SQLAgent1 were set as Service and SQL Users.

Leave a Reply

Your email address will not be published. Required fields are marked *