今天一客户使用我们软件时突然停电,再次启动软件查询SQLite数据库报 The database disk image is malformed 错误。
百度一下基本上全部是http://www.cnblogs.com/yelaiju/archive/2011/03/27/1996863.html这个方法,但这个方法对于较大的数据库根本无法解决,我遇到的数据文件有58M,导出SQL文件61M,在执行SQL时一直处于卡死状态,证明是不可行的,可能对于小的数据文件有用,没有测试过。
最后这个问题还是解决了,我的解决方法是:
下载SQLite Expert Professional,一定要Professional版(收费)的,Personal版(免费)的没有修复功能。
这里有一个绿色破解版的可以下载:http://url.cn/JVyaU5,下载之后直接解压就可以用了。
双击SQLiteExpertPro.exe,启动SQLite Expert Professional
打开要修复的sqlite数据文件,如果出现下图的提示:

说明数据库文件存在密码,点击"OK",关闭提示,在“db”上点击右键:

选择“Enter Encryption Key”:

输入数据库密码后,点击“OK”,这样数据库已经打开了,小红"x"变成了绿色的小箭头,再“db”上点击右键,选择“Repair”,如下图:

点击“Repair”后弹出对话框如下图:

http://rimland.blog.163.com/blog/static/883254620128281588906/