执行命令:php artisan migrate 报错“In Connection.php line 664: ”

报错一、
“SQLSTATE[HY000] [2002] No such file or directory”

解决方法:
把根目录下的.env 对应的mysql配置,DB_HOST改为127.0.0.1即可(我原来是“localhost”)

报错二、

 

報錯三、" SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists "


解決方法:
需要在 app/Providers/AppServiceProvider.php
头部:use Illuminate\Support\Facades\Schema;
boot方法加上“Schema::defaultStringLength(191);”

posted @ 2020-05-05 15:59  daivid  阅读(878)  评论(0)    收藏  举报