SQLite database disk image is malformed

error : database disk image is malformed

sqlite> PRAGMA integrity_check;    
Error: database disk image is malformed

sqlite> .mode insert
sqlite> .output dump.sql
sqlite> .dump
sqlite> (CTRL + D)  

sqlite3 new.db
sqlite> .read dump.sql     
sqlite> .schema              
sqlite> (CTRL + D)  

If new.db size is 0,
dump.sql 
ROLLBACK; to COMMIT;

and retry  “.read dump.sql”

Leave a Reply