SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long

在使用命令php artisan migrate生成表的过程中报错

解决方法:

/project/app/Providers/AppServiceProvider.php 中boot()方法修改如下:

public function boot()  {
 
Schema::defaultStringLength(191); //Solved by increasing StringLength
 
}

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long

上一篇:2,mongodb 的启动和安装


下一篇:SQL语句之Aggregate函数