tags:

views:

660

answers:

1

Hi,

How can I change Sqlite database from read-only to read-write? When I execute Update statement, I always got SQL error: attempt to write a readonly database.

Cheers,

+3  A: 

There can be several reasons for this error message:

  • Several processes have the database open at the same time (see the FAQ).

  • There is a plugin to compress and encrypt the database. It doesn't allow to modify the DB.

  • Lastly, another FAQ says: "Make sure that the directory containing the database file is also writable to the user executing the CGI script." I think this is because the engine needs to create more files in the directory.

Aaron Digulla
I'd place my bid on the third bullet - the directory containing the DB file should also be writable so the lock file can be created.
Kimvais