?
Solved

SQL Express deployed database is read only

Posted on 2007-12-02
3
Medium Priority
?
965 Views
Last Modified: 2013-11-27
I developed an ASP.NET website using VS Web Developer Express with an SQL Express database as an attached file.  I copied my website file and app_data folder (with contents) to the server that is going to run the website.  The server is also running SQL Express.  When I attempt to run the program and update the database I get the "Failed to update database "C:\INETPUB\WWWROOT\DOMAINREQUEST\APP_DATA\DOMAINS.MDF" because the database is read-only" error.  If I connect to the database using the SQL Manager the database option for read-only is set to false.  If I attempt to modify the [guest] and [user] permissions and then view the website I get an error that "NT AUTHORITY\NETWORK SERVICE" is unable to connect.

I've been searching the newsgroups/web for 2 days now trying to find a solution.  Please help!
0
Comment
Question by:tmayne77
  • 2
3 Comments
 
LVL 25

Expert Comment

by:imitchie
ID: 20392865
The error relates to the fact that the physical file - C:\INETPUB\WWWROOT\DOMAINREQUEST\APP_DATA\DOMAINS.MDF
is read only by the account "NT AUTHORITY\NETWORK SERVICE", which is set up to run SQL Server.
WWWROOT subfolders usually are very restrictive. Consider moving the .MDF file elsewhere.
You may have to reset permissions after the move.
0
 

Author Comment

by:tmayne77
ID: 20393332
Does this mean I should move the file elsewhere beneath the WWWROOT folder or above that somewhere in the directory structure?
0
 
LVL 25

Accepted Solution

by:
imitchie earned 1500 total points
ID: 20393350
somewhere else completely ouside of WWWROOT. Alternatively, you can leave it there, but just configure the permissions correctly. The SQL service account must be able to read/write the .MDF and .LDF files.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question