{"id":1656,"date":"2025-11-10T10:36:12","date_gmt":"2025-11-10T02:36:12","guid":{"rendered":"https:\/\/aichh.com\/?p=1656"},"modified":"2025-11-10T10:38:36","modified_gmt":"2025-11-10T02:38:36","slug":"%e4%bf%ae%e5%a4%8demby%e6%95%b0%e6%8d%ae%e5%ba%93%e6%8d%9f%e5%9d%8f","status":"publish","type":"post","link":"https:\/\/aichh.com\/1656.html","title":{"rendered":"\u4fee\u590demby\u6570\u636e\u5e93\u635f\u574f"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><p>\u4fee\u6539\u5e93\u540d\uff0c\u626b\u63cf\u5a92\u4f53\u7b49\u5199\u6570\u636e\u64cd\u4f5c\u65f6\u5931\u8d25\uff0c\u65e5\u5fd7\u63d0\u793a\u201cException of type 'SQLitePCL.pretty.SQLiteException' was thrown.\u201d<\/p>\n<p>\u6309\u5b98\u65b9\u7684\u4fee\u590d\u65b9\u6cd5\u4e0d\u6210\u529f\uff1ahttps:\/\/emby.media\/support\/articles\/Corrupt-Database.html<\/p>\n<p>\u6267\u884c\u5b8c\u6574\u6027\u6821\u9a8c\u5c31\u8fc7\u4e0d\u4e86:<\/p>\n<pre>sqlite3 library.db\r\nPRAGMA integrity_check;<\/pre>\n<p>\u63d0\u793a\uff1a<\/p>\n<pre>SQLite version 3.45.1 2024-01-30 16:01:20\r\nEnter \".help\" for usage hints.\r\nsqlite&gt; PRAGMA integrity_check;\r\nParse error: no such tokenizer: simple\r\nsqlite&gt;<\/pre>\n<p>\u6700\u540e\u5728EMBY\u8bba\u575b\u91cc\u627e\u5230\u4e86\u65b9\u6cd5\uff0c\u6309haiyjs\u63d0\u5230\u7684\u65b9\u6cd5\u4fee\u590d\u6210\u529f<\/p>\n<p>https:\/\/emby.media\/community\/index.php?\/topic\/137846-emby-server\/<\/p>\n<p>1\u3001\u5220\u9664StrmAssistant\uff08\u795e\u533b\u52a9\u624b\uff09 \u63d2\u4ef6<\/p>\n<p>2\u3001\u66f4\u65b0\u6570\u636e\u5e93<\/p>\n<p><a href=\"https:\/\/gist.github.com\/sjtuross\/5617b3dda5dddd97e1171fd6c0a758f9\" target=\"_blank\" rel=\"external nofollow noopener\">https:\/\/gist.github.com\/sjtuross\/5617b3dda5dddd97e1171fd6c0a758f9<\/a><\/p>\n<p>windows\u7cfb\u7edf\u53ef\u4ee5\u5728wsl\u4e2d\u7528\u540c\u6837\u7684\u65b9\u6cd5\u4fee\u590d\u3002<\/p>\n<pre># \u26a0\ufe0f \u8bf7\u5148\u505c\u6b62 Emby \u670d\u52a1\uff0c\u786e\u4fdd\u6570\u636e\u5e93\u6587\u4ef6\u4e0d\u5728\u4f7f\u7528\u4e2d\uff08\u975e\u5e38\u91cd\u8981\uff09\r\n# \u2705 \u6b64\u811a\u672c\u9700\u5b89\u88c5 sqlite3 \u547d\u4ee4\u884c\u5de5\u5177\uff1a\r\n#     Ubuntu \u5b89\u88c5\uff1asudo apt update &amp;&amp; sudo apt install sqlite3\r\n#     \u6216\u4ece\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\uff1ahttps:\/\/www.sqlite.org\/download.html\r\n\r\n# \u7b2c\u4e00\u6b65\uff1a\u8fdb\u5165 Emby \u914d\u7f6e\u76ee\u5f55\r\ncd \/mnt\/user\/appdata\/emby-linuxserver\r\n\r\n# \u7b2c\u4e8c\u6b65\uff1a\u5c06\u539f\u59cb library.db \u5bfc\u51fa\u4e3a SQL \u6587\u4ef6\u5907\u4efd\r\nsqlite3 data\/library.db \".dump\" &gt; data\/backup.sql\r\n\r\n# \u7b2c\u4e09\u6b65\uff1a\u4ece\u5bfc\u51fa\u6587\u4ef6\u4e2d\u79fb\u9664\u5168\u6587\u641c\u7d22 (fts_search9) \u76f8\u5173\u7684\u8868\u7ed3\u6784\u548c\u6570\u636e\r\ngrep -v -E 'fts_search9(_config|_content|_data|_docsize|_idx)?' data\/backup.sql &gt; data\/clean.sql\r\n\r\n# \u7b2c\u56db\u6b65\uff1a\u4fee\u6b63\u6700\u540e\u4e00\u884c ROLLBACK \u4e3a COMMIT\uff0c\u907f\u514d\u4e8b\u52a1\u672a\u63d0\u4ea4\r\nsed -i '$s\/^ROLLBACK; -- due to errors\/COMMIT;\/' data\/clean.sql\r\n\r\n# \u7b2c\u4e94\u6b65\uff1a\u4f7f\u7528\u6e05\u7406\u540e\u7684 SQL \u6587\u4ef6\u751f\u6210\u65b0\u7684\u6570\u636e\u5e93\u6587\u4ef6\r\nsqlite3 data\/library_new.db &lt; data\/clean.sql\r\n\r\n# \u7b2c\u516d\u6b65\uff1a\u5c06\u65b0\u6570\u636e\u5e93\u7684\u6743\u9650\u548c\u62e5\u6709\u8005\u4e0e\u539f\u59cb\u6570\u636e\u5e93\u5bf9\u9f50\r\nperm=$(stat --format '%a' data\/library.db)\r\nowner=$(stat --format '%U:%G' data\/library.db)\r\nchmod \"$perm\" data\/library_new.db\r\nchown \"$owner\" data\/library_new.db\r\n\r\n# \u7b2c\u4e03\u6b65\uff1a\u5907\u4efd\u539f\u59cb\u6570\u636e\u5e93\u53ca\u5176\u76f8\u5173\u6587\u4ef6\uff08\u5982\u679c\u5b58\u5728\uff09\r\nmv data\/library.db data\/library_bak.db\r\n[ -f data\/library.db-shm ] &amp;&amp; mv data\/library.db-shm data\/library_bak.db-shm\r\n[ -f data\/library.db-wal ] &amp;&amp; mv data\/library.db-wal data\/library_bak.db-wal\r\n\r\n# \u7b2c\u516b\u6b65\uff1a\u7528\u65b0\u7684\u6570\u636e\u5e93\u66ff\u6362\u539f\u6765\u7684 library.db\r\nmv data\/library_new.db data\/library.db<\/pre>\n<p>&nbsp;<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u4fee\u6539\u5e93\u540d\uff0c\u626b\u63cf\u5a92\u4f53\u7b49\u5199\u6570\u636e\u64cd\u4f5c\u65f6\u5931\u8d25\uff0c\u65e5\u5fd7\u63d0\u793a\u201cException of type &#8216;SQLitePCL.pretty.SQLiteException&#8217; was thrown.\u201d \u6309\u5b98\u65b9\u7684\u4fee\u590d\u65b9\u6cd5\u4e0d\u6210 \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[435,438,437],"class_list":["post-1656","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","tag-emby","tag-integrity","tag-pragma"],"views":152,"_links":{"self":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/comments?post=1656"}],"version-history":[{"count":3,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1656\/revisions"}],"predecessor-version":[{"id":1659,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/1656\/revisions\/1659"}],"wp:attachment":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/media?parent=1656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/categories?post=1656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/tags?post=1656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}