Cannot create a database...Keep getting error

  • Hey guys,

    Ran into a problem I have never seen before...

    I am logged on to a SQL Server box as sa with sa rights...

    I go to create a database, give it a name, the drives are already populated, and when I click OK, I get the following error

    CREATE FILE encountered an operating system error 5(Access denied) while attempting to open or create the file blah blah blah...

    What is this error? I even went to the drive where it will be created and created a txt file on that drive so:

    I am logged in as SA on SQL Server

    I can create a file on the drive

    Why is it not letting me create a database?

  • asm1212 (3/26/2013)


    Hey guys,

    Ran into a problem I have never seen before...

    I am logged on to a SQL Server box as sa with sa rights...

    I go to create a database, give it a name, the drives are already populated, and when I click OK, I get the following error

    CREATE FILE encountered an operating system error 5(Access denied) while attempting to open or create the file blah blah blah...

    What is this error? I even went to the drive where it will be created and created a txt file on that drive so:

    I am logged in as SA on SQL Server

    I can create a file on the drive

    Why is it not letting me create a database?

    Sounds like the service is unable to create the file. Check the windows account that is used for sql server.

    A quick google search of your error message generates dozens of hits with fixes. 😀

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Yeah what do you think the first thing I did was...GOOGLE duh!

    But we have tried those fixes..

    Alot of those fixes is talking about the .mdf file when attaching/detaching the database...problem is we dont have a .mdf file yet! We cant create the db

    We checked the services account, it is running under the login we want...That login has rights to that drive...We gave it full control!

    Yet we go to create the db and get that error!

  • asm1212 (3/26/2013)


    Yeah what do you think the first thing I did was...GOOGLE duh!

    But we have tried those fixes..

    Alot of those fixes is talking about the .mdf file when attaching/detaching the database...problem is we dont have a .mdf file yet! We cant create the db

    We checked the services account, it is running under the login we want...That login has rights to that drive...We gave it full control!

    Yet we go to create the db and get that error!

    Well the issue is pretty clear. The account does not have permission to create the file. The challenge is in figuring out why. This can be pretty tough remotely.

    Did you happen to find this thread?

    http://www.sqlservercentral.com/Forums/Topic1144210-391-1.aspx

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • The account that SQL Server is running under does not have permission to that particular folder. Your account does not matter, nor does your login to SQL Server. If you've set permissions on the drive, make sure that the folder is inheriting permissions. Actually, just go to the folder in question and check the effective permissions directly.

    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

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

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