如何连接到postgresql数据库

listen_addresses (string)

Specifies the TCP/IP address(es) on which the server is to listen for connections from client applications. The value takes the form of a comma-separated list of host names and/or numeric IP addresses. The special entry * corresponds to all available IP interfaces. The entry 0.0.0.0 allows listening for all IPv4 addresses and :: allows listening for all IPv6 addresses. If the list is empty, the server does not listen on any IP interface at all, in which case only Unix-domain sockets can be used to connect to it. If the list is not empty, the server will start if it can listen on at least one TCP/IP address. A warning will be emitted for any TCP/IP address which cannot be opened. The default value is localhost, which allows only local TCP/IP "loopback" connections to be made.

1.编辑参数文件,然后重启pg

vi $PGDATA/postgresql.conf

bash 复制代码
listen_addresses = '192.168.56.10'

2.编辑pg_hba.conf,然后运行pg_ctl reload

vi $PGDATA/pg_hba.conf

bash 复制代码
host all all 192.168.56.0/24 scram-sha-256
相关推荐
勇气要爆发2 小时前
向量数据库 Milvus 极速入门:从 Docker 部署到 Python 增删改查实战
数据库·docker·milvus
好好学操作系统2 小时前
notion+excel自动创建表格| 了解了notion api
数据库·python·oracle·excel·notion
爱吃山竹的大肚肚2 小时前
达梦(DM)数据库中设置表空间
java·数据库·sql·mysql·spring·spring cloud·oracle
启明真纳2 小时前
MySQL基本概念
数据库·mysql
wregjru2 小时前
【QT】1.QT 基础入门
数据库
2301_818732062 小时前
前端一直获取不到后端的值,和数据库字段设置有关 Oracle
前端·数据库·sql·oracle
皙然2 小时前
MyBatis 执行流程源码级深度解析:从 Mapper 接口到 SQL 执行的全链路逻辑
数据库·sql·mybatis
BXCQ_xuan3 小时前
解决飞牛nas更新后挂载硬盘提示“数据库读写失败”
数据库·飞牛nas
栗子叶3 小时前
阅读MySQL实战45讲专栏总结
数据库·mysql·innodb·主从同步·数据库原理