惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
J
Java Code Geeks
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
B
Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
美团技术团队
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
N
Netflix TechBlog - Medium
C
Check Point Blog
Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 叶小钗
T
Tailwind CSS Blog

博客园 - 喝咖啡就蒜瓣儿

通过六段代码理解join、wait、sleep、yield、endInvoke、Waitone的区别 JWT(JSON Web Tokens )简洁说明 通道、选区和蒙版:写给Ps初学者的参考 数据库中Schema(模式)概念的理解 怎样测试串口和串口线是否正常 DataTable如何删除特定行 Difference between WCF and Web API and WCF REST and Web Service C#创建带参数的线程 Application.DoEvents()和多线程 .NET Framework 工具 【转】实现Sqlite datediff日期时间相减的方法 Devexpress GridView增加CheckBox列 没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)) 如何让Advanced Installer卸载软件时保留一些文件 【转】Winform下KeyDown,KeyPress,KeyUp事件的总结 【转】C# 子窗体如何调用父窗体的方法 C# WinForm自定义控件响应键盘事件 DataTable中如何去除重复的项【转】 TAG的用法和用途[转] Sqlite: unable to open database file
【转】SQLite提示database disk image is malformed的解决方法
喝咖啡就蒜瓣儿 · 2015-06-18 · via 博客园 - 喝咖啡就蒜瓣儿

SQLite有一个很严重的缺点就是不提供Repair命令。 导致死亡提示database disk image is malformed 它的产生有很多种可能,比如,磁盘空间不足,还有就是写入数据过程中突然掉电等。

SQLite官方对问题产生原因的一些说明: http://www.sqlite.org/lockingv3.html#how_to_corrupt

(先要下载个sqlite3.exe:http://www.sqlite.org/download.html)

sqlite  my.sqlite3
sqlite>PRAGMA integrity_check;

获得提示

*** in database main ***
Page 1518: btreeInitPage() returns error code 11
On tree page 1566 cell 2: Child page depth differs
On tree page 1566 cell 3: Child page depth differs
SQL error: database disk image is malformed

可以尝试通过简单的导出导入方式对损坏的库文件作回复。 首先导出数据

sqlite3 my.sqlite3
sqlite>.output tmp.sql
sqlite>.dump
sqlite>.quit

再倒入到一个新库中

sqlite3 mynew.sqlite3
sqlite>.read tmp.sql
sqlite>.quit

这时新建的mynew.sqlite3一般可用。