安装pgAdmin
sudo yum install pgadmin4 -y # CentOS 7/8
sudo dnf install pgadmin4 -y # CentOS 9
或手动下载安装包解压后运行。sudo systemctl start pgadmin4
sudo systemctl enable pgadmin4
访问地址:http://服务器IP:端口(默认端口5050或80)。配置PostgreSQL远程连接
sudo vi /var/lib/pgsql/data/postgresql.conf # 修改listen_addresses='*'
sudo vi /var/lib/pgsql/data/pg_hba.conf # 添加host all all 0.0.0.0/0 md5
sudo systemctl restart postgresql
sudo firewall-cmd --add-port=5432/tcp --permanent
sudo firewall-cmd --reload
在pgAdmin中添加服务器连接
注意事项:
sudo systemctl status postgresql检查。