如何配置PostgreSQL以接受所有传入连接 [英] How to configure PostgreSQL to accept all incoming connections

查看:100
本文介绍了如何配置PostgreSQL以接受所有传入连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PostgreSQL数据库,我想对其进行配置以接受所有传入的连接,而不管源IP地址如何.如何在pg_hba.conf文件中进行配置?我正在使用PostgreSQL版本8.4.

I've got a PostgreSQL data base that I'd like to configure to accept all incoming connections regardless of the source IP address. How can this be configured in the pg_hba.conf file? I'm using postgreSQL version 8.4.

推荐答案

只需使用0.0.0.0/0.

host    all             all             0.0.0.0/0            md5

确保 listen_addresses postgresql.conf中(或 ALTER SYSTEM SET )允许所有可用IP接口上的传入连接.

Make sure the listen_addresses in postgresql.conf (or ALTER SYSTEM SET) allows incoming connections on all available IP interfaces.

listen_addresses = '*'

更改后,您必须重新加载配置.一种方法是以超级用户身份执行SELECT.

After the changes you have to reload the configuration. One way to do this is execute this SELECT as a superuser.

SELECT pg_reload_conf();

这篇关于如何配置PostgreSQL以接受所有传入连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆