错误:主机“172.27.0.5”没有 pg_hba.conf 条目,什么?

问题描述 投票:0回答:1

我有一个错误困扰了我好几天,当我尝试编译我的auth(rabbitmq)和我的hyper(api gateway)时,我的api有点工作,我需要下载一些包,但我的auth给出了Postgres错误。

我的pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     md5
host    replication     all             all                     md5
host    replication     all             ::1/128                 md5

当我尝试编译时,出现此错误:

错误?:

 ERROR [TypeOrmModule] Unable to connect to the database. Retrying (4)...
error: no pg_hba.conf entry for host "172.27.0.5", user "hypex", database "Hyper", no encryption

obs:我无法进入我的数据库,又出现同样的错误

其内部错误?我做了坏事?有什么解决办法吗?

node.js postgresql rabbitmq nestjs
1个回答
0
投票

我终于成功了,经过数千次的尝试和错误,我卸载了postgres sql,因为它已经安装了很长时间,然后我再次安装它并以另一种方式配置它,没有md5,使用scram-sha-256,这是由@Frank Heikens推荐,在我创建另一个项目后,我只是复制了相同的信息并更改了我的.env代码,当我再次编译auth(rabbitmq)和我的网关api时,我理解了pg_hba.conf是如何工作的,我思考。感谢那些帮助过我的人。

我的 pg_hba.conf 之后:

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all             all                        scram-sha-256
# IPv4 local connections:
host    all             all             all            scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   all     all             all                        scram-sha-256
host    all     all             all            scram-sha-256
host    all     all             ::1/128                 scram-sha-256

© www.soinside.com 2019 - 2024. All rights reserved.