我正在尝试在 DigitalOcean 液滴上部署我的 Laravel 应用程序。液滴是用 nginx、php7 和 postgres 设置的,我跟进了 DigitalOcean 的 tuts 以了解如何设置它们。然后我尝试按照本教程了解如何使用 git hook 等部署 Laravel 应用程序。
现在应用程序本身已启动并运行,我可以访问页面和所有内容。但我不能跑php artisan migrate
。我一直在更改.env
文件中的数据库用户名、名称、密码,但我总是得到完全相同的错误:
[Illuminate\Database\QueryException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy" (SQL: select * from information_schema.tables where table_schema = apollo and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy"
[PDOException]
SQLSTATE[08006] [7] FATAL: password authentication failed for user "deploy"
FATAL: password authentication failed for user "deploy"
这是我对数据库的最新.env
配置:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USERNAME=postgres
DB_DATABASE=postgres
DB_PASSWORD=[my password]
DB_SCHEMA=public
如您所见,如此荒谬的是,即使将DB_USERNAME
is 设置为postgres
,错误仍然会显示for user "deploy"
。
我一直在谷歌搜索,最接近的事情,或者我认为是这样,是/etc/postgresql/9.5/main/postgresql.conf
更新listen_addresses = '*'
. 我更新了它,重新启动了 postgres 服务,但仍然得到完全相同的错误。
任何人都可以帮助我指出我错过了什么?
谢谢。