如何连接到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
相关推荐
稀饭过霍1 分钟前
数据类型【TINYINT、SMALLINT、INT、BIGINT、decimal(18,2)】表示意思
数据库
俺不要写代码5 分钟前
数据库:DML
数据库·oracle
这个DBA有点耶8 分钟前
两张百万级大表JOIN跑崩了?试试这3招
数据库·代码规范
IntMainJhy14 分钟前
「Flutter三方库sqflite的鸿蒙化适配与实战指南:从入门到踩坑的本地数据库开发全记录」
数据库·flutter·华为·信息可视化·数据库开发·harmonyos
counting money30 分钟前
Spring框架基础(依赖注入-全注解形式)
java·数据库·spring
计算机安禾38 分钟前
【Linux从入门到精通】第33篇:数据库MySQL/MariaDB安装与基础调优
linux·数据库·mysql
瀚高PG实验室41 分钟前
ERROR: invalid input syntax for type integer: “a“
数据库·瀚高数据库
S1998_1997111609•X42 分钟前
论next/js在打击省份及犯罪行为集团的系统分析[特殊字符]设计
网络·数据库·百度·ssh·开闭原则
dfdfadffa1 小时前
如何创建仅在首次订阅时执行一次计算的 RxJS 懒加载 Observable
jvm·数据库·python
Irene19911 小时前
Oracle 中:为什么 from 子查询后面需要一个别名
数据库·oracle