0

Having trouble restoring .bak file located on desktop.

My query

RESTORE DATABASE MyDatabase 
FROM DISK='C:\Users\Mason\Desktop\48WSDB2_backup_2014_10_01_010027_0576172 - Copy.bak'

results in

Msg 3201, Level 16, State 2, Line 1 Cannot open backup device 'C:\Users\Mason\Desktop\48WSDB2_backup_2014_10_01_010027_0576172 - Copy.bak'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally.

  1. I am an administrator
  2. I ran SQL Server as an administrator.
  3. I have allowed myself full rights to myself for the desktop.

I think it might have something to do with service accounts?

migrated from stackoverflow.com Sep 26 '15 at 7:35

This question came from our site for professional and enthusiast programmers.

  • Why does this question have MySQL tags? – Dan Sep 25 '15 at 21:51
  • @Dan usually the bot suggest some random tags and OP didnt think about it. – Juan Carlos Oropeza Sep 25 '15 at 21:52
  • Did you try doing the restore from SQL Managment Studio instead of a Query? – Juan Carlos Oropeza Sep 25 '15 at 21:52
  • I think it might have something to do with service accounts? Possibly. It is the service account that is going to read the file. And it is going to read the file from the server, if that file is on a client, SQL Server will not see it. – Shannon Severance Sep 25 '15 at 21:56
  • 3
    Your "C:\" drive is not the server's "C:\" drive (unless you're running the server on your local machine). Use UNC path names (\Computer\Folder\Filename) and give the server service account access to that folder. Or, better yet, stop putting your server backups in your user desktop and put them somewhere more appropriate. – Ken White Sep 25 '15 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy