CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105)

前端 未结 25 2051
梦毁少年i
梦毁少年i 2020-12-13 23:44

I have a database file .mdf from MS SQL EXPRESS in folder:

C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA
相关标签:
25条回答
  • 2020-12-13 23:59

    In my case I have got the error when trying to create a databae on a new drive. To overcome the problem I created a new folder in that drive and set the user properties Security to full control on it(It may be sufficient to set Modify ). Conclusion: SET the Drive/Folder Properties Security for users to "Modify".

    0 讨论(0)
  • 2020-12-14 00:00

    Opening SSMS as Administrator and running as SQL Auth vs Windows Auth did not work.

    What worked was to just change my filename to the same location where the LDF and MDF files are located.

    alter database MyDB
    add file ( name = N'FileStreamName', 
    filename = N'D:\SQL Databases\FileStreamSpace' ) 
    to filegroup DocumentFiles;
    
    0 讨论(0)
  • 2020-12-14 00:01

    Here are the steps:

    1. Right click on the .mdf and .ldf file.
    2. Then select properties.
    3. On the security -> advanced -> permission add the user which
    0 讨论(0)
  • 2020-12-14 00:02

    This same problem occurs when the owners of the file have been deleted. When this happens, if you go to the file's properties, you will see a SID rather than a user name. Take ownership of the file (giving yourself FULL CONTROL). Once that is done you can do whatever you need to do with the file.

    I've had this work when logging in as the administrator didn't do the trick.

    0 讨论(0)
  • 2020-12-14 00:03

    if you have mount points add the the SQL server service account to volume security accordingly

    0 讨论(0)
  • 2020-12-14 00:04

    Start->Run->services.msc->scroll through the list of services until you find SQL Server->right-click->properties->Log On tab:

    Then choose Local System Account and check the Allow service to interact with desktop checkbox.

    Restart the service.

    0 讨论(0)
提交回复
热议问题