简体   繁体   English

无法更新数据库,因为它是只读的

[英]Failed to update database because it is read-only

I have set up my website to use ASP.NET Membership. 我已经设置了我的网站以使用ASP.NET成员资格。 it all works fine when trying to use it on my development machine but when I put it on the web server and try to log in, I get this error : 尝试在我的开发机器上使用它时一切正常但是当我把它放在Web服务器上并尝试登录时,我收到此错误:

"Failed to update database "C:\INETPUB\WWWROOT\APP_DATA\ASPNETDB.MDF" because the database is read-only. "

thanks for the help. 谢谢您的帮助。 I just found a solution. 我刚刚找到了解决方案。 in the App_Data ACL, I had two entries : Network Service and IIS_IUSRS. 在App_Data ACL中,我有两个条目:网络服务和IIS_IUSRS。 the Network Service account had full permissions but IIS_IUSRS group had only read access. 网络服务帐户具有完全权限,但IIS_IUSRS组只具有读取权限。 so, I gave IIS_IUSRS full permissions as well and it worked ! 所以,我给了IIS_IUSRS完整的权限,它也有效!

thanks again. 再次感谢。

在更改权限后,不要忘记使用“iisreset.exe”重新启动IIS

Check that file on the disk. 检查磁盘上的该文件。 Right click and go to properties. 右键单击并转到属性。

If it is a read-only file, you will need to make it writeable. 如果它是只读文件,则需要使其可写。

If the file is read-only and you can't seem to change it using the Properties window, you have to use a command prompt. 如果文件是只读的,并且您似乎无法使用“属性”窗口更改它,则必须使用命令提示符。

Refer to this Support article at Microsoft. 请参阅Microsoft的此支持文章。

I followed Attilah's answer and found: 1. Both IIS-ISUR, WebService had full pomission to the App_Data and the mdf. 我按照Attilah的回答发现:1。IIS-ISUR,WebService都对App_Data和mdf完全有所了解。 2. But someone called "asp.net 4.0 pool" and "all users" did not, so I allowed them. 但有人称“asp.net 4.0 pool”和“所有用户”都没有,所以我允许他们。

Then 3. I followed user1280392's answer to run "iisreset" but failed (but still run it pls). 然后3.我按照用户1280392的答案运行“iisreset”但失败了(但仍然运行它)。

Then I went to IIS manager and did this: 4. Clicked the server's name, clicked "restart" on the right. 然后我去了IIS管理器并执行了此操作:4。单击服务器的名称,单击右侧的“重新启动”。 5. Clicked the applications name, clicked "restart" on the right. 5.单击应用程序名称,单击右侧的“重新启动”。

and it was ok. 这没关系。

The user account that the website is running under needs write permissions on the file. 运行该网站的用户帐户需要对该文件具有写入权限。

It is also likely that the file is read-only as result of the transfer and needs to be set to be writeable. 由于传输,文件可能是只读的,需要设置为可写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM