Cannot open backup device. Operating System error 5

后端 未结 21 1196
小蘑菇
小蘑菇 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:16

    In my case, I forgot to name the backup file and it kept giving me the same permission error :/

    TO DISK N'{path}\WRITE_YOUR_BACKUP_FILENAME_HERE.bak'
    
    0 讨论(0)
  • 2020-11-30 19:20

    I face the same problem with SQL Express 2014 SP1 on Windows 10.

    Solution which work

    1. Open Service by typing Services
    2. Locate and open the SQL Server (SQLExpress)
    3. Go to the LogOn Tab
    4. Choose Local System Account ( Also Check for Allow Services to interact with desktop )
    5. Click OK . Stop the service . Restart the service.
    6. Problem solved
    0 讨论(0)
  • 2020-11-30 19:20

    SQL Server is not able to access (write) the backup into the location specified.

    First you need to verify the service account on which the Sql server is running. This can be done by using Configuration manager or Services.msc.

    or

    Use below query :

    SELECT  DSS.servicename,
        DSS.startup_type_desc,
        DSS.status_desc,
        DSS.last_startup_time,
        DSS.service_account,
        DSS.is_clustered,
        DSS.cluster_nodename,
        DSS.filename,
        DSS.startup_type,
        DSS.status,
        DSS.process_id FROM    sys.dm_server_services AS DSS;
    

    Now look at the column service_account and note it down.

    Go to the location where you are trying to take the backup.In your case : C:\Users\Me\Desktop\Backup

    Right click--> Properties --> Security -->

    Add the service account and provide read/write permissions. This will resolve the issue.

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

    I solved the same problem with the following 3 steps:

    1. I store my backup file in other folder path that's worked right.
    2. View different of security tab two folders (as below image).
    3. Edit permission in security tab folder that's not worked right.

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

    Please check the access to drives.First create one folder and go to folder properties ,

    You may find the security tab ,click on that check whether your user id having the access or not.

    if couldn't find the your id,please click the add buttion and give user name with full access.

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

    One of the reason why this happens is you are running your MSSQLSERVER Service not using a local system. To fix this issue, use the following steps.

    1. Open run using Windows + R
    2. Type services.msc and a services dialog will open
    3. Find SQL Server (MSSQLSERVER)
    4. Right click and click on properties.
    5. Go to Log on tab
    6. Select Local System account and click on "Apply" and "OK"
    7. Click on Stop link on the left panel by selecting the "SQL Server (MSSQLSERVER)" and Start it again once completely stopped.
    8. Enjoy your backup.

    Hope it helps you well, as it did to me. Cheers!

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