Postgres远程连接 - Windows服务器

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

我在pg_hba.conf有以下几行。 Postgres安装在Windows服务器上。

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
#host   all             all             myip            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5

我想只允许从一个公共IP地址连接。我怎样才能做到这一点?一旦启用上面的IP行:Postgres就无法启动。

寻求一些指导。

postgresql remote-access pg-hba.conf
1个回答
0
投票

这是不正确的语法:myip不是IP地址,缺少后的/32

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