Sqlite修复方法(database disk image is malformed)

Sqlite修复方法(database disk image is malformed),第1张

概述转自:http://hi.baidu.com/9562512/blog/item/81932e3e432bc33770cf6cd4.html   遇到 sqlite3 数据库错误 “database disk image is malformed”,G 了一下,搞定,遂记录,帮人帮己。运行 PRAGMA integrity_check; 发现 *** in database main *** On

转自:http://hi.baidu.com/9562512/blog/item/81932e3e432bc33770cf6cd4.html

遇到 sqlite3 数据库错误 “database disk image is malformed”,G 了一下,搞定,遂记录,帮人帮己。运行
PRAGMA integrity_check;
发现
*** 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

假设原数据库名 abc.db
运行命令(需要sqlite3命令行工具,可从官方下载http://www.sqlite.org/download.html)


sqlite3 abc.db
.output “_abctemp.tmp”
.dump
.quit

再建个新数据库 abc2.db

sqlite3 abc2.db
.read “_abctemp.tmp”

.quit

删除abc.db,mv abc2.db  abc.db

然后修复原来的数据库名和文件权限,应该就没事了。

总结

以上是内存溢出为你收集整理的Sqlite修复方法(database disk image is malformed)全部内容,希望文章能够帮你解决Sqlite修复方法(database disk image is malformed)所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/1177401.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-02
下一篇2022-06-02

发表评论

登录后才能评论

评论列表(0条)

    保存