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

查看:80
本文介绍了无法打开备份设备.操作系统错误 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:UsersMeDesktopBackupMyDB.Bak".操作系统错误 5(访问被拒绝.).

Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:UsersMeDesktopBackupMyDB.Bak'. Operating system error 5(Access is denied.).

消息 3013,级别 16,状态 1,第 1 行
BACKUP DATABASE 异常终止.

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

这是我的查询:

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

推荐答案

是的,我刚打了这个.

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

Look in Windows Services. Start > Administration > Services

在名为:SQL Server (MSSQLSERVER) 的列表中找到 Service 查找Log On As"列(如果列表中不存在,则需要添加它).

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 上的网络服务.如果是这种情况,您需要为实际计算机本身添加权限,例如.我的服务器$.

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天全站免登陆