wecenter安装SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max
Laravl在5.4的时候改了默认的字符集为utfmb4,支持emoji。如果数据库是mysql 5.7.7以上的话,应该是兼容的。但如果用的是mariadb或者旧的mysql版本,那么就会提示以下错误 SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
要解决错误,在AppServiceProvider.php
添加代码
use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); }