Asked 12 years, 4 months ago. Active 1 year, 3 months ago. Viewed k times. When the application didn't have permission to access the file, it gave me this error: attempt to write a readonly database Which made sense.
Improve this question. Nick Bolton Nick Bolton 4, 12 12 gold badges 50 50 silver badges 62 62 bronze badges. It think you got this problem when you were deploying. Add a comment. Active Oldest Votes. In my case, running this command fixed the problem: sudo chown www-data. Improve this answer. Rishabh Agrahari 4 4 bronze badges.
I believe the extra dot is to set the group to the owner's default group. Otherwise it doesn't change the group. This is just from memory though, I highly recommend you try that out yourself. Summarized here in case of future link rot or tl;dr: SQLite3 wants write access to the DB file's directory so that it can create a journal file there when a transaction is opened.
Great for Linux users. Bupkiss for Windows. Show 3 more comments. Already have an account? Sign in to comment. Linked pull requests. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. In my case the sqlite db file db. Finally when i moved db. I had this problem serving with Apache and found that using the absolute path to the sqlite3 db in my.
All of the permissions and ownership mentioned above are necessary as well. Tags: database , file , sql , sqlite. At a guess, it was moving the db. Toggle navigation. OperationalError: unable to open database file. OperationalError : sqlite3. Did you reload your webapp and also check the most recent errors?
0コメント