Restore Backup Access Denied

user1238565 picture user1238565 · Apr 18, 2012 · Viewed 32k times · Source

I'm trying to restore a backup from a .bak file to a local database server and keep getting the error message.

An exception occurred while executing a Transact-SQL statement or batch.(Microsoft.SqlServer.ConnectionInfo)
Cannot open backup device 'C:\Clients\SQLitis\jMKZ.bak'. Operating system error 5(Access is denied.).
RESTORE HEADERONLY is terminating abnormally. (Microsoft SQL Server, Error: 3201)

No idea where to even start troubleshooting this. I'm on an administrator account and have full privileges so there shouldn't be anything to deny me doing this but I'm still getting the error message.

Answer

HardCode picture HardCode · Apr 18, 2012

Sounds like the service account that SQL Server runs under does not have permission to folder C:\Clients\SQLitis.

When SQL Server was installed, it hopefully was set up to use a domain user account (the "service account") that is NOT an administrator on the machine. As such, the SQL Server installer only grants permissions to the folders the SQL Server setup creates.