所以我有一个几乎是基本的 Laravel 5.4 应用程序。我跑去php artisan make:auth
搭建身份验证系统。我能够迁移用户表没问题
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
但是,当我尝试注册时,会引发 SQL 无法连接错误
SQLSTATE[HY000] [2002] Connection refused (SQL: select count(*) as aggregate from `users` where `email` = email@email.com)
如果我能够成功迁移表,怎么会发生这种情况?即使在注册方法引发该错误之后,我仍然能够回滚迁移:
Rolled back: 2014_10_12_100000_create_password_resets_table
Rolled back: 2014_10_12_000000_create_users_table
并重新迁移表:
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
所以我知道 PostgreSQL 服务器已启动并正在运行。
小更新 Laravel 5.3 也发生了同样的问题,因此它与最近发布的 5.4 无关