执行命令: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 IlluminateSupportFacadesSchema;
boot方法加上“Schema::defaultStringLength(191);”

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论