要在 CentOS 上安装 PGAdmin,请按照以下步骤操作:
sudo yum update
sudo yum install -y wget
wget https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v4.26/linux-x86_64/pgadmin4-4.26-linux-x86_64.tar.gz
请注意,上述链接和版本可能会随着时间的推移而发生变化。请确保下载适用于您的系统的最新版本。
sudo tar -xvf pgadmin4-4.26-linux-x86_64.tar.gz
/opt
:sudo mv pgadmin4 /opt
pgadmin
的系统用户和组:sudo groupadd pgadmin
sudo useradd -M -r -g pgadmin pgadmin
sudo chown -R pgadmin:pgadmin /opt/pgadmin4
pgadmin.conf
的配置文件:sudo nano /etc/sysconfig/pgadmin4
在文件中添加以下内容:
# Path to the PostgreSQL server
PGADMIN_SERVER_HOST=localhost
# Port number of the PostgreSQL server
PGADMIN_SERVER_PORT=5432
# Name of the database to connect to
PGADMIN_DATABASE=postgres
# Username and password for the PostgreSQL server
PGADMIN_USERNAME=postgres
PGADMIN_PASSWORD=your_password
将 your_password
替换为您的 PostgreSQL 用户密码。
sudo systemctl restart pgadmin4
sudo systemctl enable pgadmin4
http://your_server_ip:80
,其中 your_server_ip
是您的 CentOS 服务器的 IP 地址。使用您在步骤 7 中设置的 PostgreSQL 凭据登录。现在,您已经在 CentOS 上成功安装了 PGAdmin 并可以开始管理您的 PostgreSQL 数据库了。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:centos上pgadmin怎么配置