Home > Database > Mysql Tutorial > SQL Server 2005 还原数据库错误解决方法

SQL Server 2005 还原数据库错误解决方法

WBOY
Release: 2016-06-07 17:57:46
Original
989 people have browsed it

解决SQL Server 2005 还原数据库错误:System.Data.SqlClient.SqlError: 在对 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\BusinessDB.mdf' 尝试 'RestoreContainer::ValidateTargetForCreation' 时,操作系统返回了错误 '5(拒绝访问)'

在还源数据库时出现以下错误(详情参见下图):

System.Data.SqlClient.SqlError: 在对 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\BusinessDB.mdf' 尝试 'RestoreContainer::ValidateTargetForCreation' 时,操作系统返回了错误 '5(拒绝访问。)'。 (Microsoft.SqlServer.Express.Smo)

原因分析:

没有对"C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\"创建文件的权限(可以把它复制到data),这是SQL2005对文件夹的安全性限制。

解决办法:

修改文件夹到'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\”或其他盘的文件夹下(如E:\mydb)即可。注意:mdf文件和ldf文件的路径都要修改。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template