Sqlite malformed database

From GRASS-Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Sometimes can happen to get this error using vector data

DBMI-SQLite driver error:
Error in sqlite3_step():
database disk image is malformed

DBMI-SQLite driver error:
Error in sqlite3_step():
database disk image is malformed

To solve this you can only recreate the database in a new one.

You have to move in the directory of SQLite database inside your GRASSDATA/LOCATION/MAPSET/sqlite, access sqlite.db and run

sqlite> .mode insert
sqlite> .output dump_all.sql
sqlite> .dump

Now you have to rename sqlite.db to something else (e.g. sqlite.db.old). Create a new empty database called sqlite.db, access it and run

sqlite> .read dump_all.sql