首页 > 解决方案 > heroku pg:psql --app error CLI FATAL: no pg_hba.conf entry for host "hostIp", user "user name", database "Name", SSL off

问题描述

我在我的Heroku应用程序上添加了数据库PostgreSQL,我试图通过 CLI 进行连接,我得到了与以下相同的错误:pgadmin

FATAL:  no pg_hba.conf entry for host "hostIp", user "user name", database "Name", SSL off

我尝试添加pg_hba.conf以下条目:

# IPv4 local connections:

host    all             all             127.0.0.1/32            md5
host    all             all              all                    md5

# IPv6 local connections:

host    all             all             ::1/128                 md5
host    all             all             all                     md5

仍然没有运气,希望有人可以帮助我。

标签: windowspostgresqlheroku

解决方案


对于这个答案,我假设您在 Windows 上。


我也遇到了这个问题,很快发现我错过了一个重要的步骤,即将 PostgreSQL 的二进制文件添加到 PATH 环境变量中。这是我发现的地方:

请记住更新 PATH 环境变量以添加 Postgres 安装的 bin 目录。该目录将类似于:C:\Program Files\PostgreSQL<VERSION>\bin。如果您忘记更新 PATH,则 heroku pg:psql 之类的命令将不起作用。


推荐阅读