{"id":145,"date":"2021-01-04T11:30:29","date_gmt":"2021-01-04T11:30:29","guid":{"rendered":"https:\/\/blog.gwlin.com\/?p=145"},"modified":"2023-03-31T22:15:35","modified_gmt":"2023-03-31T22:15:35","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\/145","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":"\n<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\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\"  lang=\"php\" class=\"language-php\">use Illuminate\\Support\\Facades\\Schema;\n\npublic function boot()\n{\n    Schema::defaultStringLength(191);\n}<\/code><\/pre>\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":[192,186],"class_list":["post-145","post","type-post","status-publish","format-standard","hentry","category-notes","tag-laravel","tag-php"],"_links":{"self":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/145","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=145"}],"version-history":[{"count":0,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gwlin.com\/blog\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}