windows - 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
仍然没有运气,希望有人可以帮助我。
解决方案
对于这个答案,我假设您在 Windows 上。
我也遇到了这个问题,很快发现我错过了一个重要的步骤,即将 PostgreSQL 的二进制文件添加到 PATH 环境变量中。这是我发现的地方:
请记住更新 PATH 环境变量以添加 Postgres 安装的 bin 目录。该目录将类似于:C:\Program Files\PostgreSQL<VERSION>\bin。如果您忘记更新 PATH,则 heroku pg:psql 之类的命令将不起作用。
推荐阅读
- java - SSL 致命错误
- cassandra - 如何集成 dropwizard 指标来监控 cassandra 数据库
- c# - 根据经纬度匹配路线和方向
- ios - 空 tableView 上没有结果标签
- hadoop - 我们可以使用 nosql 数据库作为 Hive 元存储吗?
- python - 如何在 Python 中组合嵌套循环的结果
- listview - 我们如何在 react-native 中水平显示数据类别列表
- sql-server - SQL Server 如果我们为 SELECT 和 UPDATE 保持打开 TRAN 是否有任何影响
- hyperledger-fabric - 在使用 kafka 配置时提及订购者名称
- c# - 一对多关系中的唯一名称