File tree 3 files changed +69
-3
lines changed
3 files changed +69
-3
lines changed Original file line number Diff line number Diff line change 41
41
manga.md
42
42
auto_tool.bat
43
43
auto_tool.py
44
+ db.sql
45
+ export.sqlite3
44
46
/mdict /readlib /src /readmdict-py3 /
45
47
! /static /json /manifest.json
46
48
! /static /json /index_en.json
Original file line number Diff line number Diff line change @@ -135,11 +135,43 @@ Do not set the django-mdict folder and the folder where the dictionary is locate
135
135
136
136
22 . django.db.utils.DatabaseError: database disk image is malformed
137
137
138
+ For Windows:
139
+
138
140
a. [ Download sqlite tool] ( https://www.sqlite.org/download.html )
139
141
142
+ a.1 Download sqlite-dll-win-x64-3460000.zip and extract it to a certain path.
143
+
144
+ a.2 Add this path to the system environment variable Path.
145
+
140
146
b. [ Repair db.sqlite3 file] ( https://blog.csdn.net/qq_41539778/article/details/136531120 )
141
147
142
- c. Rename exported file to db.sqlite3.
148
+ b.1. Navigate to the root directory of django-mdict in the command prompt (cmd).
149
+
150
+ b.2. Export the contents of the corrupted db.sqlite3 to db.sql.
151
+
152
+ ```
153
+ sqlite3 db.sqlite3
154
+ .mode insert
155
+ .output db.sql
156
+ .dump
157
+ .exit
158
+ ```
159
+ b.3. Export db.sql to export.sqlite3.
160
+
161
+ ```
162
+ sqlite3
163
+ .open export.sqlite3
164
+ .read db.sql
165
+ .exit
166
+ ```
167
+
168
+ b.4. Rename export.sqlite3 and replace the corrupted db.sqlite3.
169
+
170
+ b.5. If django-mdict is deployed in WSL, you also need to change the read and write permissions for db.sqlite3 in WSL.
171
+
172
+ ```
173
+ chmod 777 db.sqlite3
174
+ ```
143
175
144
176
23 . django.db.utils.OperationalError: attempt to write a readonly database
145
177
Original file line number Diff line number Diff line change @@ -129,11 +129,43 @@ pip install -U django-js-asset
129
129
130
130
22 . django.db.utils.DatabaseError: database disk image is malformed
131
131
132
+ 以windows为例:
133
+
132
134
a. [ 下载sqlite工具] ( https://www.sqlite.org/download.html )
133
135
134
- b. [ 修复db.sqlite3文件] ( https://blog.csdn.net/qq_41539778/article/details/136531120 )
136
+ a.1 下载sqlite-dll-win-x64-3460000.zip,解压到某个路径
137
+
138
+ a.2 将该路径加入到系统环境变量Path中
139
+
140
+ b. 修复db.sqlite3文件
141
+
142
+ b.1. 在cmd中cd到django-mdict根目录
143
+
144
+ b.2. 将损坏的db.sqlite3的内容导出到db.sql
145
+
146
+ ```
147
+ sqlite3 db.sqlite3
148
+ .mode insert
149
+ .output db.sql
150
+ .dump
151
+ .exit
152
+ ```
153
+ b.3. 将db.sql导出为export.sqlite3
135
154
136
- c. 将导出文件重命名为db.sqlite3.
155
+ ```
156
+ sqlite3
157
+ .open export.sqlite3
158
+ .read db.sql
159
+ .exit
160
+ ```
161
+
162
+ b.4. 将export.sqlite3重命名并替换损坏的db.sqlite3
163
+
164
+ b.5. 如果django-mdict部署在wsl中,还需在wsl中更改db.sqlite3的读写权限
165
+
166
+ ```
167
+ chmod 777 db.sqlite3
168
+ ```
137
169
138
170
23 . django.db.utils.OperationalError: attempt to write a readonly database
139
171
You can’t perform that action at this time.
0 commit comments