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

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

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

报错二、
01.png
03.png

報錯三、" SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists "
深度截图_选择区域_20200303213658.png
解決方法:
需要在 app/Providers/AppServiceProvider.php
头部:use IlluminateSupportFacadesSchema;
boot方法加上“Schema::defaultStringLength(191);”
深度截图_选择区域_20200303214007.png

评论

暂无评论