PHP

首页 -  PHP  -  执行php artisan migrate出错 SQLSTATE[42S01]:

执行php artisan migrate出错 SQLSTATE[42S01]:

laravel5.4在执行php artisan migrate出现错误:

[PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'shusers' already exists

原因是因为mysql的版本低utf8mb4的字节不够。

解决方法:

app\Providers\AppServiceProvider.php

给boot方法添加入下代码
public function boot()
{
   Schema::defaultStringLength(191);
}
(45)
分享:

本文由:xiaoshu168 作者:xiaoshu发表,转载请注明来源!

标签:

相关阅读