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


基础教程推荐
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01