Laravel Nova + Homestead SQLSTATE[HY000] [2002] 连接被拒绝
Laravel Nova + Homestead SQLSTATE[HY000] [2002] Connection refused
我全新安装了 Homestead 7.17.0、Laravel 5.7.2 和 Laravel Nova 1.0.14,但是当我尝试使用用户名和密码登录时,我添加到用户的 table,我收到以下错误:
Illuminate\Database\QueryException SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `users` where `email` = user@email.com limit 1)
我确定我的 .env 文件中的数据库配置是正确的。实际上,我通过我创建的和 artisan 命令添加了用户,这证明主应用程序可以毫无问题地连接到数据库。
仔细检查你的端口,当我在我的 Mac 上使用 Homestead 时,运行 artisan 命令的端口是 3306 但要在浏览器中加载 Web 应用程序,它需要是 33060
我全新安装了 Homestead 7.17.0、Laravel 5.7.2 和 Laravel Nova 1.0.14,但是当我尝试使用用户名和密码登录时,我添加到用户的 table,我收到以下错误:
Illuminate\Database\QueryException SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `users` where `email` = user@email.com limit 1)
我确定我的 .env 文件中的数据库配置是正确的。实际上,我通过我创建的和 artisan 命令添加了用户,这证明主应用程序可以毫无问题地连接到数据库。
仔细检查你的端口,当我在我的 Mac 上使用 Homestead 时,运行 artisan 命令的端口是 3306 但要在浏览器中加载 Web 应用程序,它需要是 33060