1. 查找配置文件

# find / -name pg_hba.conf
# find / -name postgresql.conf

2.修改

  2.1 修改pg_hba.conf

 查找IPv4 local connections

   修改默认的

host all all 127.0.0.1/32 trust

 为

host all all 192.168.1.1/32 trust #IP全匹配
或
host all all 192.168.1.1/24 trust #IP匹配前三段
或
host all all 0.0.0.0/0 trust #全部允许

  2.2 修改postgresql.conf

 查找 Connection Settings

 修改默认的

listen_addresses = 'localhost'

 为

listen_addresses = '*'

 

重启postgresql服务

 

1. 查找配置文件

# find / -name pg_hba.conf
# find / -name postgresql.conf

2.修改

  2.1 修改pg_hba.conf

 查找IPv4 local connections

   修改默认的

host all all 127.0.0.1/32 trust

 为

host all all 192.168.1.1/32 trust #IP全匹配
或
host all all 192.168.1.1/24 trust #IP匹配前三段
或
host all all 0.0.0.0/0 trust #全部允许

  2.2 修改postgresql.conf

 查找 Connection Settings

 修改默认的

listen_addresses = 'localhost'

 为

listen_addresses = '*'

 

重启postgresql服务

 

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2022-02-01
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案