【发布时间】:2017-07-11 22:43:10
【问题描述】:
我正在尝试在 DigitalOcean 液滴上部署我的 Laravel 应用程序。液滴是用 nginx、php7 和 postgres 设置的,我跟进了 DigitalOcean 的 tuts 以了解如何设置它们。然后我尝试关注this tutorial,了解如何使用 git hook 等部署 Laravel 应用。
现在应用程序本身已启动并运行,我可以访问页面和所有内容。但我无法运行php artisan migrate。我一直在更改 .env 文件上的数据库用户名、名称、密码,但我总是得到 exact 相同的错误:
[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 设置为postgres,错误仍然会显示for user "deploy"。
我一直在谷歌搜索,最接近的事情,或者我认为是这样,是更新/etc/postgresql/9.5/main/postgresql.conf 上的一些配置,即生成listen_addresses = '*'。我更新了它,重新启动了 postgres 服务,但仍然得到完全相同的错误。
谁能帮我指出我错过了什么?
谢谢。
【问题讨论】:
-
这里只是一个长镜头。不是解决方案。尝试清除您的配置缓存。
php artisan config:cache. -
@EddyTheDove 有效!但是现在似乎每次更改配置时都必须清除缓存。有没有更好的解决方案?
-
您在特定环境中实际配置的频率。无论如何,您可以使用
php artisan config:clear来避免缓存。 -
你是对的,谢谢伙计!
标签: postgresql laravel laravel-5.3 psql artisan-migrate