如何连接到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
相关推荐
秋94 分钟前
windows中安装redis
数据库·redis·缓存
Cosolar25 分钟前
万字详解:RAG 向量索引算法与向量数据库架构及实战
数据库·人工智能·算法·数据库架构·milvus
想唱rap33 分钟前
IO多路转接之poll
服务器·开发语言·数据库·c++
SeaTunnel41 分钟前
AI 让 SeaTunnel 读源码和调试过时了吗?
大数据·数据库·人工智能·apache·seatunnel·数据同步
凯瑟琳.奥古斯特1 小时前
数据冗余与规范化的本质[数据库原理]
开发语言·数据库·职场和发展
_ku_ku_2 小时前
数据库系统原理 · SQL 数据定义、更新及数据库编程 · 自学总结
数据库·oracle
Mortalbreeze2 小时前
深度理解文件系统 ---- 从磁盘存储到内核存储
大数据·linux·数据库
2301_803934612 小时前
MySQL 字段类型选择规范指南
jvm·数据库·python
oddsand13 小时前
Redis网络模型
java·数据库·redis
皮卡祺q3 小时前
【redies0-导论】分布式系统的演进-引进redis原因
java·数据库·redis