mssql '5 (Access is denied.)' error during restoring database
I recently had this problem. The fix for me was to go to the Files page of the Restore Database dialog and check "Relocate all files to folder".
The account that sql server is running under does not have access to the location where you have the backup file or are trying to restore the database to. You can use SQL Server Configuration Manager to find which account is used to run the SQL Server instance, and then make sure that account has full control over the .BAK file and the folder where the MDF will be restored to.
Well, In my case the solution was quite simple and straight.
I had to change just the value of log On As
value.
Steps to Resolve-
- Open
Sql Server Configuration manager
- Right
click on SQL Server (MSSQLSERVER
) - Go to
Properties
- change
log On As
value toLocalSystem
Hoping this will help you too :)