微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PostgreSQL10配置远程连接

Postgresql10配置远程连接

psql --version

centos7.3中

1、开启相应的防火墙端口,允许端口5432

2、访问权限配置/etc/postgresql/10/main/下的pg_hba.conf

 

分享图片

 

 

分享图片

# TYPE  DATABASE        USER            ADDRESS                 METHOD

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

3、监听机器配置/etc/postgresql/10/main/下的postgresql.conf

 

分享图片

# - Connection Settings -

listen_addresses = ‘*‘      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to ‘localhost‘; use ‘*‘ for all
                    # (change requires restart)
#port = 5432                # (change requires restart)

centos6.8中

上述文件/var/lib/pgsql/10/data/路径下

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐