在 CentOS 上,“打开 pgAdmin”通常分两种情况:本地图形界面 和 通过浏览器访问(pgAdmin4 Web 模式)。下面一步步说。
rpm -qa | grep pgadmin
或
yum list installed | grep pgadmin
如果没装:
sudo yum install -y pgadmin4
(需要先配置 PostgreSQL 官方 yum 源)
sudo systemctl start httpd
# 或(取决于安装方式)
sudo systemctl start pgadmin4
设置开机启动:
sudo systemctl enable httpd
在能访问该服务器的浏览器中输入:
http://服务器IP/pgadmin4
或本地:
http://localhost/pgadmin4
首次打开需要:
sudo yum install -y pgadmin4-desktop
pgadmin4
检查:
sudo systemctl status httpd
sudo firewall-cmd --list-all
开放端口:
sudo firewall-cmd --add-port=80/tcp --permanent
sudo firewall-cmd --reload
确认访问路径:
/pgadmin4
而不是 /
如果你愿意,可以告诉我:
我可以直接给你一条可执行命令方案。