Why can#39;t I read from .BAK files on my Desktop using SQL Express in Windows Authentication Mode(为什么我无法在 Windows 身份验证模式下使用 SQL Express 从桌面上的 .BAK 文件中读取)
问题描述
我正在尝试在 SQL Express 中恢复 .BAK 文件之前执行此 SQL 查询.最初,我在用户帐户的桌面上有该文件.我以管理员身份登录.
I am trying to execute this SQL query prior to restoring a .BAK file in SQL Express. Initially, I had the file on the Desktop of my user account. I am logged in as Administrator.
当我尝试像这样访问桌面上的 .BAK 文件时
When I try to access the .BAK file on the desktop like this
RESTORE FILELISTONLY FROM DISK= 'C:\Documents and Settings\Administrator\Desktop\file.bak'
出现错误.
Msg 3201, Level 16, State 2, Line 1
Cannot open backup device 'C:\Documents and Settings\Administrator\Desktop\file.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.
但是,当我将 .BAK 文件移动到 C:\temp 并执行此
However, when I move the .BAK file to C:\temp, and execute this
RESTORE FILELISTONLY FROM DISK= 'C:\temp\file.bak'
效果很好.
我无法弄清楚发生了什么.有没有办法通过 SQL Express 使用 Windows 身份验证访问桌面上的文件?
I cant figure out what is going on. Is there a way to access files on Desktop using Windows Authentication with SQL Express?
推荐答案
尝试授予 Users 或 LOCAL SERVICE 对文件夹 C:\Documents and Settings\ 的读取权限策略编辑器中的 Administrator\Desktop\(右键单击该文件夹,然后在安全"选项卡中单击添加...",然后单击高级..."|立即查找
Try granting read permission to Users or LOCAL SERVICE to the folder C:\Documents and Settings\Administrator\Desktop\ in your Policy Editor (right click the folder and in the Security tab click Add... then Advanced...|Find Now
这篇关于为什么我无法在 Windows 身份验证模式下使用 SQL Express 从桌面上的 .BAK 文件中读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为什么我无法在 Windows 身份验证模式下使用 SQL
基础教程推荐
- SQL Server 实例在登录协商期间返回无效或不受支持的协议版本 2021-01-01
- SQL:使用来自具有相同列名的两个表中的数据... 2021-01-01
- 如何使用 mysql.connector 禁用查询缓存 2022-01-01
- SQL 效率:WHERE IN 子查询 vs. JOIN 然后 GROUP 2021-01-01
- 将 SQL Server DateTime 列迁移到 DateTimeOffset 2021-01-01
- SSMS 中的权限问题:“对象 'extended_properties'、数据库 'mssqlsystem_resource'、... 错误 229)上的 SELECT 权限被拒绝" 2022-01-01
- 是否可以执行按位分组功能? 2021-01-01
- 在 SQL 中连接多个表 2021-01-01
- 无法解决整理冲突 2021-01-01
- 需要 MySQL 5.1 中的抽象触发器来更新审计日志 2021-01-01
