{"id":5450,"date":"2021-01-04T11:30:43","date_gmt":"2021-01-04T11:30:43","guid":{"rendered":"https:\/\/blog.gwlin.com\/?p=5450"},"modified":"2023-04-01T01:33:50","modified_gmt":"2023-04-01T01:33:50","slug":"\u89e3\u51b3 Laravel \u9519\u8bef  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes","status":"publish","type":"post","link":"https:\/\/www.gwlin.com\/blog\/posts\/5450","title":{"rendered":"\u89e3\u51b3 Laravel \u9519\u8bef  SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes"},"content":{"rendered":"<p>Laravl\u57285.4\u7684\u65f6\u5019\u6539\u4e86\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6\u4e3autfmb4\uff0c\u652f\u6301emoji\u3002\u5982\u679c\u6570\u636e\u5e93\u662fmysql 5.7.7\u4ee5\u4e0a\u7684\u8bdd\uff0c\u5e94\u8be5\u662f\u517c\u5bb9\u7684\u3002\u4f46\u5982\u679c\u7528\u7684\u662fmariadb\u6216\u8005\u65e7\u7684mysql\u7248\u672c\uff0c\u90a3\u4e48\u5c31\u4f1a\u63d0\u793a\u4ee5\u4e0b\u9519\u8bef <code class=\"prettyprint\" >SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes<\/code>\u8981\u89e3\u51b3\u9519\u8bef\uff0c\u5728<code>AppServiceProvider.php<\/code>\u6dfb\u52a0\u4ee3\u7801<\/p>\n<pre><code class=\"PHP\">&lt;span class=&quot;hljs-selector-tag&quot;&gt;use&lt;\/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;IlluminateSupportFacadesSchema&lt;\/span&gt;;\r\n\r\n&lt;span class=&quot;hljs-selector-tag&quot;&gt;public&lt;\/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;function&lt;\/span&gt; &lt;span class=&quot;hljs-selector-tag&quot;&gt;boot&lt;\/span&gt;()\r\n{\r\n    &lt;span class=&quot;hljs-attribute&quot;&gt;Schema&lt;\/span&gt;::&lt;span class=&quot;hljs-built_in&quot;&gt;defaultStringLength&lt;\/span&gt;(&lt;span class=&quot;hljs-number&quot;&gt;191&lt;\/span&gt;);\r\n}<\/code><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Laravl\u57285.4\u7684\u65f6\u5019\u6539\u4e86\u9ed8\u8ba4\u7684\u5b57\u7b26\u96c6\u4e3autfmb4\uff0c\u652f\u6301emoji\u3002\u5982\u679c\u6570\u636e\u5e93\u662fmysql 5.7.7\u4ee5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179],"tags":[],"class_list":["post-5450","post","type-post","status-publish","format-standard","hentry","category-notes"],"_links":{"self":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/5450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/comments?post=5450"}],"version-history":[{"count":0,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/5450\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/media?parent=5450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/categories?post=5450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/tags?post=5450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}