首页 > 代码库 > Cannot open backup device

Cannot open backup device

在还原数据库备份文件时,SQL Server 抛出错误消息:
Cannot open backup device ‘\\xxx\yyy.bak‘. Operating system error 5(Access is denied.).

错误原因是SQL Server 需要访问实例以外的资源,bak文件,但是SQL Server Services没有足够的权限,因此,抛出访问被拒绝(“Access is denied”)的错误消息。必须赋予MS SQL Server Services Account足够的权限。

依次按键:Windows+R,输入services.msc,打开Services,找到Service:SQL Server (MSSQLSERVER) ,打开其Properties 窗体,切换到Log On tab。

将默认的 NT Service\MSSQLSERVER 修改为Windows 域账号,并赋予相应的权限。

技术分享

 

Cannot open backup device