Software⏱️ 4 min read📅 2026-06-03

How to Fix error 5 Error – Cannot open backup device. Operating System error 5

SQL Server Backup Error: Access Denied

Quick Answer: Verify that the SQL Server service account has write permissions to the backup location and check for any open processes using the same file.

The error message 'Cannot open backup device 'C:\Users\Me\Desktop\Backup\MyDB.Bak'. Operating system error 5(Access is denied.)' affects users who are trying to create a backup of their database using SQL Server. This error can be frustrating for database administrators as it prevents them from successfully backing up their data, leading to potential data loss.

This issue typically occurs when the user account running the SQL Server Backup tool does not have sufficient permissions to write to the specified backup location. The solution involves granting the necessary permissions to the user account or changing the backup location to a directory that is accessible by the current user.

🔍 Why This Happens

  • The primary reason for this error is insufficient file system permissions on the backup device. When the SQL Server Backup tool attempts to write to the specified backup location, it encounters an access denied error if the user account does not have write access to that directory.
  • Another possible cause is a corrupted or locked backup file, which can prevent the SQL Server Backup tool from writing to the backup device.

🚀 How to Resolve This Issue

Granting File System Permissions

  1. Step 1: Step 1: Open the File Explorer and navigate to the C:\Users\Me\Desktop\Backup directory. Right-click on the MyDB.Bak file and select Properties.
  2. Step 2: Step 2: In the Properties window, click on the Security tab and then click on Edit. This will open the Permissions window.
  3. Step 3: Step 3: Click Add and enter the username of the user account running the SQL Server Backup tool in the Enter the object names to select field. Then, check the Select user or group checkbox and click Check Names.
  4. Step 4: Step 4: Once the user account is added, click OK to close all the windows and then try running the backup query again.

Changing Backup Location

  1. Step 1: Step 1: Update the TO DISK clause in the backup query to point to a different directory that is accessible by the current user. For example, you can use the Desktop or Documents folder.
  2. Step 2: Step 2: Ensure that the new backup location has the necessary file system permissions for the SQL Server Backup tool to write to it.
  3. Step 3: Step 3: Run the backup query again with the updated TO DISK clause to verify that the backup is successful.

💡 Conclusion

To resolve the 'Cannot open backup device' error, database administrators can try granting file system permissions to the user account running the SQL Server Backup tool or changing the backup location to a directory that is accessible by the current user. By following these steps, users can successfully create backups of their databases and prevent potential data loss.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions