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

时间:2022-09-11 17:05:26

I have set up my website to use ASP.NET Membership. 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 :

我已经设置了我的网站以使用ASP.NET成员资格。尝试在我的开发机器上使用它时一切正常但是当我把它放在Web服务器上并尝试登录时,我收到此错误:

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

6 个解决方案

#1


11  

thanks for the help. I just found a solution. in the App_Data ACL, I had two entries : Network Service and IIS_IUSRS. the Network Service account had full permissions but IIS_IUSRS group had only read access. so, I gave IIS_IUSRS full permissions as well and it worked !

谢谢您的帮助。我刚刚找到了解决方案。在App_Data ACL中,我有两个条目:网络服务和IIS_IUSRS。网络服务帐户具有完全权限,但IIS_IUSRS组只具有读取权限。所以,我给了IIS_IUSRS完整的权限,它也有效!

thanks again.

#2


5  

Don't forget to restart the IIS with "iisreset.exe" after altering the permissions

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

#3


2  

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.

如果它是只读文件,则需要使其可写。

#4


2  

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的此支持文章。

#5


1  

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.

由于传输,文件可能是只读的,需要设置为可写。

#6


1  

I followed Attilah's answer and found: 1. Both IIS-ISUR, WebService had full pomission to the App_Data and the mdf. 2. But someone called "asp.net 4.0 pool" and "all users" did not, so I allowed them.

我按照Attilah的回答发现:1。IIS-ISUR,WebService都对App_Data和mdf完全有所了解。但有人称“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. 5. Clicked the applications name, clicked "restart" on the right.

然后我去了IIS管理器并执行了此操作:4。单击服务器的名称,单击右侧的“重新启动”。 5.单击应用程序名称,单击右侧的“重新启动”。

and it was ok.

这没关系。

#1


11  

thanks for the help. I just found a solution. in the App_Data ACL, I had two entries : Network Service and IIS_IUSRS. the Network Service account had full permissions but IIS_IUSRS group had only read access. so, I gave IIS_IUSRS full permissions as well and it worked !

谢谢您的帮助。我刚刚找到了解决方案。在App_Data ACL中,我有两个条目:网络服务和IIS_IUSRS。网络服务帐户具有完全权限,但IIS_IUSRS组只具有读取权限。所以,我给了IIS_IUSRS完整的权限,它也有效!

thanks again.

#2


5  

Don't forget to restart the IIS with "iisreset.exe" after altering the permissions

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

#3


2  

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.

如果它是只读文件,则需要使其可写。

#4


2  

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的此支持文章。

#5


1  

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.

由于传输,文件可能是只读的,需要设置为可写。

#6


1  

I followed Attilah's answer and found: 1. Both IIS-ISUR, WebService had full pomission to the App_Data and the mdf. 2. But someone called "asp.net 4.0 pool" and "all users" did not, so I allowed them.

我按照Attilah的回答发现:1。IIS-ISUR,WebService都对App_Data和mdf完全有所了解。但有人称“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. 5. Clicked the applications name, clicked "restart" on the right.

然后我去了IIS管理器并执行了此操作:4。单击服务器的名称,单击右侧的“重新启动”。 5.单击应用程序名称,单击右侧的“重新启动”。

and it was ok.

这没关系。