






[root@postgre-sql ~]# su - postgres 上一次登录:三 12月 13 18:10:00 CST 2023pts/0 上 [postgres@postgre-sql ~]$ [postgres@postgre-sql ~]$ ps -ef | grep postgre postgres 1685 1 0 12月13 ? 00:00:00 /opt/postgresql-16.1/bin/postgres -D /data/16.1/data postgres 1686 1685 0 12月13 ? 00:00:00 postgres: checkpointer postgres 1687 1685 0 12月13 ? 00:00:00 postgres: background writer postgres 1689 1685 0 12月13 ? 00:00:00 postgres: walwriter postgres 1690 1685 0 12月13 ? 00:00:00 postgres: autovacuum launcher postgres 1691 1685 0 12月13 ? 00:00:00 postgres: logical replication launcher root 4659 4642 0 13:25 pts/0 00:00:00 su - postgres postgres 4660 4659 0 13:25 pts/0 00:00:00 -bash postgres 4683 4660 0 13:26 pts/0 00:00:00 ps -ef postgres 4684 4660 0 13:26 pts/0 00:00:00 grep --color=auto postgre [postgres@postgre-sql ~]$ 安装路径为: /opt/postgresql-16.1/
数据库Data路径为:/data/16.1/data
找到# IPv4 local connections:和# IPv6 local connections
在# IPv4 local connections:下方# IPv6 local connections上方加上
host all all 0.0.0.0/0 md5 如图
保存并退出
找到
#listen_addresses = '127.0.0.1' 修改为
listen_addresses = '*' 找到
#port = 5432 修改为
port = 5432 保存并退出
[root@postgre-sql ~]# systemctl restart postgresql.service [root@postgre-sql ~]# 
数据库已经联机成功了











