无法打开备份设备.操作系统错误5 [英] Cannot open backup device. Operating System error 5

查看:1358
本文介绍了无法打开备份设备.操作系统错误5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我用来备份(创建.bak)数据库的查询.

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:

消息3201,第16级,状态1,第1行
无法打开备份设备"C:\ Users \ Me \ Desktop \ Backup \ MyDB.Bak".操作系统错误5(访问被拒绝.).

Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\Users\Me\Desktop\Backup\MyDB.Bak'. Operating system error 5(Access is denied.).

消息3013,第16级,状态1,第1行
备份数据库异常终止.

Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

这是我的查询:

BACKUP DATABASE AcinsoftDB
TO DISK = 'C:\Users\Me\Desktop\Backup\MyDB.Bak'
WITH FORMAT,
MEDIANAME = 'C_SQLServerBackups',
NAME = 'Full Backup of MyDB';

推荐答案

是的,我刚刚对此进行了评分.

Yeah I just scored this one.

查看Windows服务.开始>管理>服务

Look in Windows Services. Start > Administration > Services

在名为:SQL Server(MSSQLSERVER)的列表中找到该服务,查找登录为"列(如果列表中不存在,则需要添加).

Find the Service in the list called: SQL Server (MSSQLSERVER) look for the "Log On As" column (need to add it if it doesn't exist in the list).

这是您需要授予目录权限的帐户,右键单击资源管理器>属性>共享(和安全性)

This is the account you need to give permissions to the directory, right click in explorer > properties > Shares (And Security)

注意:请记住,如果要访问网络,则要授予对实际目录和共享的权限.

NOTE: Remember to give permissions to the actual directory AND to the share if you are going across the network.

应用并等待权限传播,然后再次尝试备份.

Apply and wait for the permissions to propogate, try the backup again.

注意2 :如果您正在通过网络进行备份并且SQL以本地服务"的身份运行,那么您将遇到麻烦...您可以尝试分配权限,否则可能更容易本地备份,并在SQL Server外部(一小时后)进行xcopy.

NOTE 2: if you are backing up across the network and your SQL is running as "Local Service" then you are in trouble ... you can try assigning permissions or it may be easier to backup locally and xcopy across outside of SQL Server (an hour later).

注意3 :如果您作为网络​​服务运行,则有时远程计算机将无法识别SQL Server上的网络服务.在这种情况下,您需要为实际计算机本身添加权限,例如. MyServer $.

NOTE 3: If you're running as network service then SOMETIMES the remote machine will not recognize the network serivce on your SQL Server. If this is the case you need to add permissions for the actual computer itself eg. MyServer$.

这篇关于无法打开备份设备.操作系统错误5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆