Skip to Content

How to Fix Database Access Denied Error 5123 happen on SQL Server 2008 R2?

Table of Contents

Problem

Error 5123 is displayed when you’re trying to attach a database in SQL Server 2008 R2 that was previously detached by another user with a different login.

CREATE FILE encountered operating system error 5 (Access is denied) while attempting to open or create the physical file… (Microsoft SQL Server, Error 5123)

SQL Server 2008 R2 Database error 5123

Solution

  1. In the Security tab of the Properties dialog, selected OWNER RIGHTS in the “Group or user names” section, the listed permissions were empty for both Allow and Deny.
  2. Click on Advanced and, from that view, OWNER RIGHTS had all permissions checked.
  3. Click Edit and ensure that all check boxes are set for Allow.

Database Security tab