Thursday, May 5, 2016

Fixed - Unable to open the physical file (attach) on MSSQL server

Problem :
Msg 5120, Level 16, State 101, Line 1 Unable to open the physical file "C:\beruk\mung\Databases.mdf". Operating system error 5: "5(Access is denied.)".

Solution :
  1. Press Win+R (Run dialog)
  2. Type services.msc on open dialog and press OK
  3. Search service name of SQL Server (MSSQLSERVER) or SQL Server (SQLEXPRESS) depending on you server instance name.
  4. Right click > Properties
  5. Click on Log On tab menu
  6. Select Local Account and press OK
  7. Right click on service name again and choose Stop
  8. Right click on service name again and choose Start
Now, open SQL Server 20** management studio and login as usual, try to attach you database. It should worked as expected.  

No comments:

Post a Comment