您的当前位置:首页>全部文章>文章详情
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length
发表于:2022-07-13 09:22:29浏览:2143次TAG: #laravel

laravel报错 “ SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes”
原因:mysql版本较低
解决办法:
app\Providers\AppServiceProvider.php 下
修改boot()方法添加如下代码

Schema::defaultStringLength(191);