例:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users
add unique users_email_unique
(email
))
这种错误
直接在app/Providers/AppServiceProvider.php中的
引入 use Illuminate\Support\Facades\Schema;
在boot方法中添加
Schema::defaultStringLength(191);
注:如果还有Mysql执行安全模式检查问题
在config/database.php 的mysql的 选项配置了严格模式默认为true,修改为:’strict’ => false,