执行php artisan migrate报错laravel报错1071 Specified key was too long; max key length is 1000 bytes
Laravel 5.4以后默认使用utf8mb4字符编码,而不是之前的utf8编码。因此运行php artisan migrate 会出现了上面的错误。
修改App\Providers\AppServiceProvider.php文件
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
Comment here is closed