Operating system error 5: "5(Access is denied.)".

  • Hi
    Can anybody advise me, what is wrong or what am i doing wrong?

  • The account that SQL Server is running under does not have access to your users folder. Hence the OS permission denied error

    Best thing to do is to create the DB in the default database location, and to put the files there first.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Quick thought, either the right permissions aren't in place or this might even be a space issue, have you checked the error log?
    😎

  • Eirikur Eiriksson - Wednesday, November 15, 2017 1:10 AM

    Quick thought, either the right permissions aren't in place or this might even be a space issue, have you checked the error log?
    😎

    It's permission denied, not insufficient space. They're very different OS errors.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster - Wednesday, November 15, 2017 1:20 AM

    Eirikur Eiriksson - Wednesday, November 15, 2017 1:10 AM

    Quick thought, either the right permissions aren't in place or this might even be a space issue, have you checked the error log?
    😎

    It's permission denied, not insufficient space. They're very different OS errors.

    Agreed. Considering the OP's image (both the DB being used and the name of the PC) I imagine the OP's instance is probably running under the NT AUTHORITY/NetworkService account; thus has no access to the OP's own Documents folder.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • I have managed to install one DB(AdventureWorksLT2012_Data.mdf).
    For the other two, i'm getting this error "
    The header for file 'C:\Users\Anthony\Documents\TSQL ADVENTUREWORKS\AdventureWorks2012_Data.mdf' is not a valid database file header. The FILE SIZE property is incorrect."

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply