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.
- 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.
January 20, 2017 @ 2:39 pm
This solved my problem on a windows 10 local installation.
MS SQL 2014
Thanks
May 12, 2017 @ 1:14 pm
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.
August 14, 2017 @ 11:38 pm
The Authenticated users trick worked for me too on SQL 2012
October 3, 2017 @ 4:27 pm
This Solved my problem on Windows Server 2012 Essentials. Great!!!! Thanks for this blog.
June 8, 2018 @ 7:07 pm
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.
July 30, 2018 @ 12:53 pm
this works!
October 19, 2018 @ 6:09 am
Thanks mate, your method worked for me, thanks a ton !!!!!!
January 7, 2019 @ 10:21 pm
thanks it solved my problem
April 16, 2019 @ 3:50 am
Thx mate, it works:)
July 29, 2019 @ 6:25 am
Thanks !! it works…
November 14, 2019 @ 5:29 pm
Thanks !!! It helped me a lot!
May 3, 2020 @ 3:33 pm
This worked for me. Thanks!
June 22, 2020 @ 11:20 am
Thanks. That fixed my issue.
September 9, 2020 @ 4:39 am
thank you, solved my problem
October 6, 2020 @ 1:28 pm
this was helpful!
November 1, 2020 @ 4:13 pm
This user doesn’t exist when setting properties on the folder (how to type it in so it finds it?)
NT Service\MSSQL$SQLEXPRESS
December 30, 2021 @ 5:36 am
Still working
June 11, 2018 @ 11:20 pm
Kartheek thanks for the post! That solved my problem like a magic wand breaking a spell!
July 12, 2018 @ 4:46 am
Thanks Kartheek! It works
July 20, 2018 @ 11:33 am
Thank you Kartheek
July 22, 2018 @ 6:22 am
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.
August 5, 2018 @ 6:05 pm
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.
November 8, 2018 @ 2:15 am
This really answered my problem, thank you!
November 28, 2018 @ 3:31 pm
Great!!! Worked for me allowing full access to Authenticated Users on the shared permissions of the backup folder.
Windows 2008 R2
January 26, 2019 @ 1:13 pm
Very helpful thanks for that.
May 20, 2019 @ 5:59 pm
Thanks Kartheek. That got it working again.
May 23, 2019 @ 2:02 pm
Worked for SQL server 2014 Management Studios
July 1, 2019 @ 8:28 am
Thanks Kartheek!
Worked great for SQL server 2017 v17.9.1
September 21, 2019 @ 4:38 am
Thank you
it worked forme
December 21, 2020 @ 8:54 am
This helped me this morning. Thank you
February 3, 2021 @ 7:37 am
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’