首页 文章

语法错误或访问冲突:1067 'created_at'的默认值无效

提问于
浏览
2

我安装了laravel 5.5并且当我运行 php artisan migrate 时告诉我这个错误

[Illuminate \ Database \ QueryException] SQLSTATE [42000]:语法错误或访问冲突:1071指定密钥太长;最大密钥长度为767字节(SQ L:alter table users添加唯一users_email_unique(email))

我在 AppServiceProvider.php 上添加以下代码

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

然后告诉我这个错误

[Illuminate \ Database \ QueryException] SQLSTATE [42000]:语法错误或访问冲突:1067“created_at”的默认值无效(SQL:create table password_resets(email varchar(191)not null,token varchar(191)not null, created_at timestamp not null)de fault character set utf8mb4 collate utf8mb4_unicode_ci)

1 回答

相关问题