默认情况下,postgresql是只允许localhost连接的,如果需要使用远程连接,需要修改两个配置文件。

postgresql.conf 和 pg_hba.conf

在postgresql.conf找到 #listen_addresses = 'localhost' ,取消前面的注释符号#,并且将localhost改为*

在pg_hba.conf里添加一行:

host    all              all             192.168.1.0/24        md5

ip地址按需修改

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2021-09-25
  • 2021-11-23
  • 2022-02-04
  • 2021-06-09
猜你喜欢
  • 2022-12-23
  • 2021-11-05
  • 2021-07-01
  • 2021-07-27
  • 2022-02-04
  • 2022-12-23
相关资源
相似解决方案