Database is read-only 的解决方法

转载 2006年05月17日 22:23:00

You need Read/Write permission on both MDF and LDF in order to editing data.  If you're using IIS 6.0, you need to add Network Process account and give Read/Write permission to these two files.  You also need to detach the database before changing the permissions on the file.  You can do this using SSEUtil.exe tool:

> SSEUtil.exe -child "NT Authority/Network Service" -detach


- What is Network Process Account.
>>>  This account is use by IIS6.  For more detail on the account, see

    - How can i create it.
>>> It should already created for you
    - What do you mean by detach.
>>> you need to detach the database to release the current info in master database; so that the next time you load the page, it load the new permission for this database
    - how can i use this tool for the same, as it is doing nothing when i have tried,
>>> here're the steps:

   1) open window explorer, go to your app_data folder of your web project (e.g. d:/mywebsite/app_data folder)
   2) select both *.mdf and *.ldf, right mouse click and click on Properties
   3) click on security tab, click "Add" button
   4) type <your Machine Name>/Network Service in the "Enter the object names to select textbox, click ok
   5) make sure Read and Write permissions checkboxes are checked and click ok
   6) open cmd window (assuming you already have a copy of SSEUtil tool)
   7) type SSEUtil -d d:/mywebsite/app_data/test.mdf  --- this step detach the database
   8) run your page

Hope that help,

1.  Delete the MDF/LDF files from the App_Data directory of the website under inetpub/wwwroot. 
2.  Download and install the SSEUTIL command line tool from:
3.  Using sseutil, issue a command that looks something like:  sseutil -child "NT AUTHORITY/NETWORK SERVICE" -detach D:/  .  You will need to change the account name and the detach path to match your machine settings.  If on IIS5/5.1, then ASPNET will be the correct user account.  Also, you can determine the detach path pretty easily by issuing sseutil -list to see where the problematic MDFs are currently attached.  The "D:/" in the sample command line is just the first few characters that sseutil uses to auto-detach all databases that begin with "D:/".  Change the path as neeeded for your machine.
4.  Set the ACLs on App_Data directory under inetpub/wwwroot to grant R/W to the appropriate process account - NETWORK SERVICE on WS03 or ASPNET on IIS5/5.1.
5.  Re-copy the MDF/LDF files from the directory where the file-based website exists back into App_Data under inetpub/wwwroot.  After the copy occurs, check that the MDF/LDF files have now inherited the new ACLs.
6.  Re-run the application (ignore any connection errors that might occur - just hit refresh in the browser).

We are working on a fix in SSE that will eliminate the manual reconfiguration for RTM.



It's probably read only because the user that the SQL Server service runs as
only has read permissions on the files. Change the Windows permissions and
restart the database service.

hive 不同用户 权限设置 出错处理

今天安装了hive 在a账号安装的,一切正常 但是到其他账户下,报错 >show tables; Error in metadata: java.lang.RuntimeException: Unab...
  • AresGod
  • AresGod
  • 2013年07月17日 22:09
  • 7677


  • mls_programmer
  • mls_programmer
  • 2015年11月03日 17:20
  • 1801


1.     could not find java.dll C:\Users\admin>java Error: Registry key 'Software\JavaSoft\JavaRunt...
  • rchm8519
  • rchm8519
  • 2015年01月12日 15:40
  • 55758

Linux下MySQL出现#1036 – Table ‘ ‘ is read only 等错误解决方法

因为linux权限问题,我们在对mysql数据库操作出现如下错误的解决方案: 错误原因:一般都是我们将数据库文件从一个服务器或者本地转移到另一个linux机下时,原本我们在mysql新建的库或...
  • z15818264727
  • z15818264727
  • 2016年08月19日 16:59
  • 533

Linux文件虚拟机系统只读Read-only file system的快速解决方法

  • jien1109
  • jien1109
  • 2014年09月09日 14:53
  • 6628

Linux文件系统只读Read-only file system的解决方法

问题原因:系统没有正常关机,导致虚拟磁盘出现文件系统错误。 解决方法:使用fsck手动修复,具体操作如下: 重启系统后使用root进入单用户模式,运行 fsck.ext3 -y /dev/v...
  • wackycrazy
  • wackycrazy
  • 2015年11月24日 14:29
  • 5473

C#出现sqlite的database is locked的解决方法

用C#和sqlite开发了一个小管理程序,但是最后测试的时候发现多次添加、删除时总会报错,database is locked。...
  • goodelephant
  • goodelephant
  • 2014年03月05日 09:50
  • 4206

在bochs上运行freedos,在freedos上运行我们的代码-解决mount:block device pm.img is write-protected,mounting read-only

  • faileast_weiwei
  • faileast_weiwei
  • 2015年01月10日 21:17
  • 1191

小议:SharePoint Content Database Status: Read Only与Offline

我们知道SharePoint依赖于SQL Server的Content Database来做数据存储的,但有些企业在管理数据时会提出很多需求:比如Content Database 1只存储客户信息...
  • ShelleyLiu0415
  • ShelleyLiu0415
  • 2015年09月01日 10:06
  • 1345

andrroid couldn't open database for writing(will try read-only)

 andrroid couldn't open database for writing(will try read-only) androi
  • q9977144
  • q9977144
  • 2014年06月27日 18:22
  • 2126
您举报文章:Database is read-only 的解决方法