SQLite 错误:database disk image is malformed - 数据库磁盘映像格式不正确

SQLite 错误:database disk image is malformed - 数据库磁盘映像格式不正确

出现原因:磁盘空间不足,或者写入数据过程中突然断电等

解决方法1:1、从原库中导出脚本   2、新建库导入脚本

//导出脚本tmp.sql
sqlite3 test.db
sqlite>.output tmp.sql
sqlite>.dump
sqlite>.quit

//把数据导入新的库中
sqlite3 testDB 
sqlite>.read tmp.sql
sqlite>.quit

解决方法2:

  1、使用数据库工具,从原库中导出自己想要的数据(除了 sqlite_sequence 表,初步判断是这个表损坏导致)

  2、删除.db,新建db ,导入自己的数据  

 

 

 

创建时间:2022.08.03  更新时间:2022.08.04

posted on 2022-08-04 08:38  滔Roy  阅读(10585)  评论(0编辑  收藏  举报

导航