Sqlite malformed database: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(create page how to restore malformed sqlite database)
 
 
Line 26: Line 26:
sqlite> .read dump_all.sql
sqlite> .read dump_all.sql
</pre>
</pre>
[[Category:FAQ]]

Latest revision as of 10:20, 2 July 2016

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