Cannot open backup device. Operating System error 5

后端 未结 21 1199
小蘑菇
小蘑菇 2020-11-30 18:59

Below is the query that I am using to backup (create a .bak) my database.

However, whenever I run it, I always get this error message:

相关标签:
21条回答
  • 2020-11-30 19:34

    I had the same issue and the url below really helped me.

    It might help you as well.

    http://blog.sqlauthority.com/2011/04/13/sql-server-fix-error-msg-3201-level-16-cannot-open-backup-device-operating-system-error-5access-is-denied/

    0 讨论(0)
  • 2020-11-30 19:35

    The SQL Server service account does not have permissions to write to the folder C:\Users\Kimpoy\Desktop\Backup\

    0 讨论(0)
  • 2020-11-30 19:38

    Msg 3201, Level 16, State 1, Line 1 Cannot open backup device 'C:\Backup\Adventure_20120720_1024AM.trn'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 1 BACKUP LOG is terminating abnormally.

    I verified backup folder on C drive, Is new service account is having full control access permission or not?, I realized that "Test\Kiran" service account is not having Full control security permission.

    Please follow the below steps to give full control to service account:

    1. Go to C drive, Right click on Backup folder.
    2. Select Security tab.
    3. Click on Edit button, new window will open.
    4. Click on Add button and enter Test\Kiran user account and click check name button, this will validate you entered user is existing or not, if it is existing it will show the user on window, select OK.
    5. Select you entered user name and select Full Control check box under allow.
    0 讨论(0)
  • 2020-11-30 19:39

    I was just going through this myself. I had ensured that my MSSQLSERVER login user had full access but it was still causing issues. It only worked once I moved the destination to the root of C. More importantly out of a user folder (even though I had a share with full permissions - even tried "Everyone" as a test).

    I don't know if i consider my issue "fixed", however it is "working".

    Just a FYI for any other users that come across this thread.

    0 讨论(0)
  • 2020-11-30 19:40

    I had a similar issue. I added write permissions to the .bak file itself, and my folder that I was writing the backup to for the NETWORK SERVICE user. To add permissions just right-click what file/directory you want to alter, select the security tab, and add the appropriate users/permissions there.

    0 讨论(0)
  • 2020-11-30 19:40

    Share this folder and use UNC path, by example: \pc\backups\mydb.bak

    Then You can stop share.

    Not very elegant, but it resolves all permissions problems (You need to give permissions to share as well, as mentioned above)

    0 讨论(0)
提交回复
热议问题