如何连接到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
相关推荐
蜡笔小炘19 小时前
LVS -- 利用防火墙标签(FireWall Mark)解决轮询错误
服务器·数据库·lvs
韩立学长19 小时前
基于Springboot泉州旅游攻略平台d5h5zz02(程序、源码、数据库、调试部署方案及开发环境)系统界面展示及获取方式置于文档末尾,可供参考。
数据库·spring boot·旅游
Re.不晚20 小时前
MySQL进阶之战——索引、事务与锁、高可用架构的三重奏
数据库·mysql·架构
老邓计算机毕设20 小时前
SSM智慧社区信息化服务平台4v5hv(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·ssm 框架·智慧社区、·信息化平台
麦聪聊数据21 小时前
为何通用堡垒机无法在数据库运维中实现精准风控?
数据库·sql·安全·低代码·架构
2301_7903009621 小时前
Python数据库操作:SQLAlchemy ORM指南
jvm·数据库·python
m0_7369191021 小时前
用Pandas处理时间序列数据(Time Series)
jvm·数据库·python
亓才孓21 小时前
[JDBC]PreparedStatement替代Statement
java·数据库
m0_4665252921 小时前
绿盟科技风云卫AI安全能力平台成果重磅发布
大数据·数据库·人工智能·安全
爱学习的阿磊1 天前
使用Fabric自动化你的部署流程
jvm·数据库·python