执行数据库迁移报错 Doctrine\DBAL\Driver\PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specif ied key was too long; max key length is 1000 bytes")
Closed this issue · 1 comments
liuxiaojin93 commented
执行 php artisan migrate,解决设置
在app/Providers/AppServiceProvider.php中修改
use Illuminate\Support\Facades\Schema;
public function boot()
{
//
Schema::defaultStringLength(191);
}
然后再执行 php artisan migrate
moell-peng commented
@liuxiaojin93 建议升级mysql版本至>=5.7 吧,Laravel 现在也是这样要求的。