Attach Database “Operating System Error 5 (Access is denied)” MSSQL Server 2012.

,

When I try to attach mdf file I got following error below.


Solution:

There are multiple solutions to this

1    1.    Move .mdf and .ldf to SQLServer install directory Data folder (eg C:Program Files (x86)Microsoft SQL ServerMSSQL10.SQLEXPRESSMSSQLDATA) and then attach.
2    2. Give SQL SERVER SERVICE account full access to folder where mdf and ldf files are located.
3       3. Run as Administrator as in Below screens.

Run SSMS as admin as shown in screen below

Original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating