Unable to update database .MDF is Read Only

前端 未结 5 1830
感情败类
感情败类 2021-01-14 10:44

I have a local DB that I have in an application. When I install it on another machine I get the error

Unable to update database.. .mdf is read only.<

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-14 11:22

    The MDF file would be readonly either because the readonly file attribute flag is set, in which case you have to unset it, or another program has the MDF file locked as readonly. Are you running a version of SQL server that is using that file?

    I've never seen a connection to the MDF file directly, usually it's done via the server, and the server will manage all the IO for the MDF file.

    E.g. a typical connection string for SQL Server:

    Database=;Server=;MultipleActiveResultSets=True;Connection Timeout=10;User Id=;Password=;
    

    Additional links:

    1) Failed to update .mdf database because the database is read-only (Windows application)

    2) Failed to update database because it is read-only

    3) Failed to update database "*.mdf" because read only EntityFramework

    4) http://www.codeproject.com/Questions/183758/Failed-to-update-mdf-database-because-the-database

提交回复
热议问题