{"id":200414,"date":"2025-05-06T12:57:55","date_gmt":"2025-05-06T04:57:55","guid":{"rendered":"https:\/\/server.hk\/cnblog\/200414\/"},"modified":"2025-05-06T12:57:55","modified_gmt":"2025-05-06T04:57:55","slug":"nextcloud%e6%90%ad%e5%bb%ba%e6%97%b6%e9%81%87%e5%88%b0sqlstate42000-syntax-error-or-access-violation-1071-specified-key-was-too-long-max-key-length-is-1000-bytes%e9%94%99","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/200414\/","title":{"rendered":"Nextcloud\u642d\u5efa\u65f6\u9047\u5230\u201cSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\u201d\u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>Nextcloud\u642d\u5efa\u65f6\u9047\u5230\u201cSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\u201d\u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f<\/h1>\n<p>\u5728\u6570\u636e\u5e93\u5b9e\u6218\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e9b\u8fd9\u6837\u90a3\u6837\u7684\u95ee\u9898\uff0c\u7136\u540e\u8981\u5361\u597d\u534a\u5929\uff0c\u7b49\u95ee\u9898\u89e3\u51b3\u4e86\u624d\u53d1\u73b0\u539f\u6765\u4e00\u4e9b\u7ec6\u8282\u77e5\u8bc6\u70b9\u8fd8\u662f\u6ca1\u6709\u638c\u63e1\u597d\u3002\u4eca\u5929\u4e3b\u673a\u5b9d\u8d1d\u5c31\u6574\u7406\u5206\u4eab\u300aNextcloud\u642d\u5efa\u65f6\u9047\u5230\u201cSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\u201d\u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u300b\uff0c\u804a\u804a\uff0c\u5e0c\u671b\u53ef\u4ee5\u5e2e\u52a9\u5230\u6b63\u5728\u52aa\u529b\u8d5a\u94b1\u7684\u4f60\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241104\/17307160556728a1970bbe5.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>nextcloud\u642d\u5efa\u65f6\u9047\u5230\u7684SQL\u62a5\u9519<\/strong><\/p>\n<p>\u5728\u4f7f\u7528Nextcloud\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6570\u636e\u5e93\uff08SQL\uff09\u62a5\u9519\uff0c\u5176\u5177\u4f53\u62a5\u9519\u4fe1\u606f\u4e3a\uff1a\u201cSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\u201d\u3002\u9020\u6210\u6b64\u62a5\u9519\u7684\u539f\u56e0\u662fNextcloud\u7684\u5b89\u88c5\u9700\u8981\u4f7f\u7528InnoDB\u5b58\u50a8\u5f15\u64ce\uff0c\u4f46\u6b64\u65f6\u4f7f\u7528\u7684SQL\u7248\u672c\u4e3amysql-5.5\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u672a\u5f00\u542fInnoDB\u5f15\u64ce\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong><\/p>\n<p>\u8981\u89e3\u51b3\u6b64\u62a5\u9519\uff0c\u9700\u8981\u5728AMH\u9762\u677f\u4e2d\u5f00\u542fInnoDB\u5f15\u64ce\uff1a<\/p>\n<ul>\n<li>\u767b\u5f55AMH\u9762\u677f<\/li>\n<li>\u8fdb\u5165\u300e\u6570\u636e\u5e93\u300f\u83dc\u5355<\/li>\n<li>\u5728\u300e\u53c2\u6570\u914d\u7f6e\u300f\u9009\u9879\u5361\u4e2d\uff0c\u627e\u5230\u300eInnoDB\u5f15\u64ce (InnoDB_Engine)\u300f\u9879<\/li>\n<li>\u5c06\u5176\u8bbe\u7f6e\u4e3a\u300e\u5f00\u542f\u300f<\/li>\n<\/ul>\n<p>\u5f00\u542fInnoDB\u5f15\u64ce\u540e\uff0c\u91cd\u65b0\u5b89\u88c5Nextcloud\u5373\u53ef\u89e3\u51b3\u6b64SQL\u62a5\u9519\u3002\u786e\u4fdd\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9009\u62e9\u6b63\u786e\u7684\u6570\u636e\u5e93\u53c2\u6570\uff0c\u5305\u62ec\u6570\u636e\u5e93\u7c7b\u578b\u3001\u4e3b\u673a\u3001\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u6570\u636e\u5e93\u540d\u79f0\u548c\u6570\u636e\u5e93\u5b57\u7b26\u96c6\u3002<\/p>\n<p>\u672c\u7bc7\u5173\u4e8e\u300aNextcloud\u642d\u5efa\u65f6\u9047\u5230\u201cSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\u201d\u9519\u8bef\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u7684\u4ecb\u7ecd\u5c31\u5230\u6b64\u7ed3\u675f\u5566\uff0c\u4f46\u662f\u5b66\u65e0\u6b62\u5883\uff0c\u60f3\u8981\u4e86\u89e3\u5b66\u4e60\u66f4\u591a\u5173\u4e8e\u6570\u636e\u5e93\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u8bf7\u5173\u6ce8\u4e3b\u673a\u5b9d\u8d1d\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Nextcloud\u642d\u5efa\u65f6\u9047\u5230\u201cS&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-200414","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=200414"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/200414\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=200414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=200414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=200414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}