Search code examples
sql-serveraccess-denied

During Restore Database the operating system returned the error '5(access is denied.) why?


I got Database file with .bak format and I need to import it to my SQL Server. When Restore Database there is an error: the operating system returned the error '5(access is denied.). Here are photos:

photos


Solution

  • Thank you all for the comments. I found the answer here:

    SQL Server Restore Error - Access is Denied

    Relocate all files to folder should be checked in the 'Files' section: just like in the post. And here is photo: Relocate all files to folder

    Also, in the 'Options' section I checked the 'Overwrite the existing database(WITH REPLACE)' and after that it worked.

    Overwrite the existing database(WITH REPLACE)