locked
Not able to attach or restore northwind.mdf and northwind.ldf files RRS feed

  • Question

  • Hi,

    I downloaded nothwind.mdf and nothwind.ldf  files from the net.when I try to attach any of these files, i am getting the error as "Unable to open the physical file "d:\northwind.mdf".Operating system error5. 5 Access is denied.

    Can you please help me to resolve this issue?

    Tuesday, October 12, 2010 6:34 PM

Answers

  • Your SQL server service account should have read / write access to the folder where your mdf and ldf sits. This should get you out of this problem
    Thanks, Leks
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Tuesday, October 12, 2010 7:33 PM
  • Operating system error 5. Access is denied.

    Pleae check if the SQL Server Service account has access on the file d:\northwind.mdf.

    Check the permissions for the  file, the directory it is in, and the volume it is on. If the MSSQLServer service is running under the "LocalSystem" account, then "System" should have Full Control over the volume, directory, and file. Make sure the device file's attribute is not set to Read Only.


    Sivaprasad S http://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Wednesday, October 13, 2010 12:35 AM
  • Thanks...I am new to SQL server.How to check whether the SQL server service account has access on the mdf file?

    and  MSSQLServer service is running under the "Network Service"  (I could see this in Services.msc --> Log on As column).

    I am sure that the mdf file's attribute is not Read Only.


    Check the file and folder permissions in Windows (right-click, security or properties, security, etc...).
    No great genius has ever existed without some touch of madness. - Aristotle
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Wednesday, October 13, 2010 5:30 AM

All replies

  • Your SQL server service account should have read / write access to the folder where your mdf and ldf sits. This should get you out of this problem
    Thanks, Leks
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Tuesday, October 12, 2010 7:33 PM
  • Operating system error 5. Access is denied.

    Pleae check if the SQL Server Service account has access on the file d:\northwind.mdf.

    Check the permissions for the  file, the directory it is in, and the volume it is on. If the MSSQLServer service is running under the "LocalSystem" account, then "System" should have Full Control over the volume, directory, and file. Make sure the device file's attribute is not set to Read Only.


    Sivaprasad S http://sivasql.blogspot.com Please click the Mark as Answer button if a post solves your problem!
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Wednesday, October 13, 2010 12:35 AM
  • Thanks...I am new to SQL server.How to check whether the SQL server service account has access on the mdf file?

    and  MSSQLServer service is running under the "Network Service"  (I could see this in Services.msc --> Log on As column).

    I am sure that the mdf file's attribute is not Read Only.

    Wednesday, October 13, 2010 4:18 AM
  • Thanks...I am new to SQL server.How to check whether the SQL server service account has access on the mdf file?

    and  MSSQLServer service is running under the "Network Service"  (I could see this in Services.msc --> Log on As column).

    I am sure that the mdf file's attribute is not Read Only.


    Check the file and folder permissions in Windows (right-click, security or properties, security, etc...).
    No great genius has ever existed without some touch of madness. - Aristotle
    • Proposed as answer by Lekss Wednesday, October 13, 2010 7:53 PM
    • Marked as answer by Tom Li - MSFT Wednesday, October 27, 2010 9:37 AM
    Wednesday, October 13, 2010 5:30 AM
  • Copy this mdf and ldf file in to a folder in a D:\drive rather than putting it on the root . Then grant READ\WRITE permission for that folder for networkservice account and then you will be able to attach the database
    Thanks, Leks
    Wednesday, October 13, 2010 6:46 AM
  • Thanks Lekss , Joe and Siva...thanks a lot :) It works :)
    Wednesday, October 13, 2010 4:54 PM