加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-12 23:29:44 所属栏目:百科 来源:网络整理
导读:转自:http://hi.baidu.com/9562512/blog/item/81932e3e432bc33770cf6cd4.html 遇到 sqlite3 数据库错误 “database disk image is malformed”,G 了一下,搞定,遂记录,帮人帮己。 运行 PRAGMA integrity_check; 发现 *** in database main *** On tree

遇到 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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

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

    推荐文章
      热点阅读