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.
This solved my problem on a windows 10 local installation.
MS SQL 2014
Thanks
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.
The Authenticated users trick worked for me too on SQL 2012
This Solved my problem on Windows Server 2012 Essentials. Great!!!! Thanks for this blog.
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.
this works!
Thanks mate, your method worked for me, thanks a ton !!!!!!
thanks it solved my problem
Thx mate, it works:)
Thanks !! it works…
Thanks !!! It helped me a lot!
This worked for me. Thanks!
Thanks. That fixed my issue.
thank you, solved my problem
this was helpful!
This user doesn’t exist when setting properties on the folder (how to type it in so it finds it?)
NT Service\MSSQL$SQLEXPRESS
Still working
Thank you! Followed your steps and solved issue
its very helpful for me
Kartheek thanks for the post! That solved my problem like a magic wand breaking a spell!
Thanks Kartheek! It works
Thank you Kartheek
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.
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.
This really answered my problem, thank you!
Great!!! Worked for me allowing full access to Authenticated Users on the shared permissions of the backup folder.
Windows 2008 R2
Very helpful thanks for that.
Thanks Kartheek. That got it working again.
Worked for SQL server 2014 Management Studios
Thanks Kartheek!
Worked great for SQL server 2017 v17.9.1
Thank you
it worked forme
This helped me this morning. Thank you
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’
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.