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

前端 未结 25 2052
梦毁少年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-14 00:19

    As other suggested running as administrator will help.

    However this only if the windows user is actually an admisnitrator on the machine which sql server runs.

    For example when using SSMS from a remote machine it will not help using "run as administartor" if the user is only a administrator on the machine runing SSMS but not on the machine running SQL Server.

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

    If you are already running as an adminstrator, make sure the user you are using has the proper server roles.

    1. Login as sa (if you can)
    2. Expand the Security folder
    3. Expand the Logins Folder
    4. Right click on the user you would like to use
    5. Select Properties
    6. Select Server Roles
    7. Select all the server roles
    8. Click OK
    9. Restart SSMS
    10. Login with the modified user
    0 讨论(0)
  • 2020-12-14 00:22

    In my case, Run as Administrator does not help. I solved the problem by changing the Build-in Account to Local System in Configuration Manager.

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

    My solution was slightly more complicated. After verifying the user the service was running as, running MSSMS as local and domain administrator, and checking folder permissions, I was still getting this error. My solution?

    Folder ownership was still maintained by local account.

    Properties > Security > Advanced > Owner > (domain/local user/group SQL services are running as)

    This resolved the issue for me.

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

    Here is what happened in my case. I was asked to attach files for a database. I was given the file names as follows

    • devdb.mdf and devdb.ldf

    I proceeded to attach the files and kept getting the files are in use by another process.

    I ran a query against the system view select name, physical_name from sys.master_files; and saw that the exact file names were already in use by another database, thus each time I tried to attach the files, I kept getting the error the files are in use by another process(sql server)

    Thus if you are getting such a message, then also query against the system view sys.master_files and see which database may already be using the same name files. Hereafter you will figure out what to do.

    thanks.

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

    I had the same problem. After several tries, I realized that connecting the sql server with windows authentication resolved the issue.

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