Discussion:
[sqlite] error "attempt to write a readonly database"
Paul Sanderson
2015-03-07 16:42:06 UTC
Permalink
I have a database I have created and populated with various tables and data.

I now want to create a new table and I get the above error.

command is create table testtab (id int, data blob);

I am using sqlite 3.8.6 command line to try and create the table
(although the DB was created using Devarts UniDac) .

I am on windows, NTFS file system and the error occurs after a reboot
so nothing should be holding the DB open. The file itself is not
flagged as read only by the OS.

I can run the same command on a different DB in the same folder

Pragma integrity_check is OK

The table testtab does not already exist

Any ideas of why i can't create the table/why the db is flagged readonly?

Thanks
Simon Slavin
2015-03-07 17:56:11 UTC
Permalink
Post by Paul Sanderson
I have a database I have created and populated with various tables and data.
I now want to create a new table and I get the above error.
command is create table testtab (id int, data blob);
If you are not already doing so, try using the SQLite shell tool to execute that command and see if you get the same error.

The database may be read-only for several reasons. You can explicitly ask SQLite to open it read-only. The file may be marked for read-only access for your user. The folder may be marked for read-only access, which would prevent SQLite from creating a journal file for changes. And several other causes.

Simon.
Paul Sanderson
2015-03-07 19:31:43 UTC
Permalink
Thanks Simon

I'm an idiot - dev environment was running as admin - so nothing else
could write to DB out side of this as a normal users.







Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence
Post by Simon Slavin
Post by Paul Sanderson
I have a database I have created and populated with various tables and data.
I now want to create a new table and I get the above error.
command is create table testtab (id int, data blob);
If you are not already doing so, try using the SQLite shell tool to execute that command and see if you get the same error.
The database may be read-only for several reasons. You can explicitly ask SQLite to open it read-only. The file may be marked for read-only access for your user. The folder may be marked for read-only access, which would prevent SQLite from creating a journal file for changes. And several other causes.
Simon.
_______________________________________________
sqlite-users mailing list
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Simon Slavin
2015-03-07 19:44:31 UTC
Permalink
Post by Paul Sanderson
I'm an idiot - dev environment was running as admin - so nothing else
could write to DB out side of this as a normal users.
A mistake we've all made. Glad you figured it out.

Simon.
Paul Sanderson
2015-03-07 20:18:35 UTC
Permalink
Thanks - you pointed me in the right direction.
Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence
Post by Simon Slavin
Post by Paul Sanderson
I'm an idiot - dev environment was running as admin - so nothing else
could write to DB out side of this as a normal users.
A mistake we've all made. Glad you figured it out.
Simon.
_______________________________________________
sqlite-users mailing list
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Continue reading on narkive:
Search results for '[sqlite] error "attempt to write a readonly database"' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
Loading...