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


- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- SQL 临时表问题 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01