From: http://hi.baidu.com/9562512/blog/item/81932e3e432bc33770cf6cd4.html
In the case of sqlite3 Database Error "Database disk image is malformed", I ran it for a moment and got it done. I recorded it and helped people to help me. Run
Pragma integrity_check;
Found
* ** In database main ***
On tree page 120611 cell 0: 3 of 4 pages missing from overflow list starting at 120617
On tree page 120616 cell 0: 3 of 4 pages missing from overflow list starting at 120621
On tree page 3309 cell 0: 3 of 4 pages missing from over
Assume that the original database nameabc.db
Run the command (sqlite3 command line tool is required, you can download the http://www.sqlite.org/download.html from the official)
sqlite3 abc.db
. Output "_ abctemp. tmp"
. Dump
. Quit
Create a new databaseabc2.db
sqlite3 abc2.db
. Read "_ abctemp. tmp"
. Quit
Delete ABC. DB, MV abc2.db ABC. DB
Fix the original database name and file permissions, and it should be okay. |