要在CentOS上安裝pgAdmin,您可以按照以下步驟操作:
sudo yum update -y
sudo yum install -y wget
sudo yum install epel-release -y
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
sudo groupadd pgadmin
sudo useradd -M -r -g pgadmin pgadmin
sudo chown -R pgadmin:pgadmin /opt/pgadmin4
sudo nano /etc/sysconfig/pgadmin4
在文件中添加以下內容,并替換your_password
為您的PostgreSQL用戶密碼:
# 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
sudo systemctl restart pgadmin4
sudo systemctl enable pgadmin4
在瀏覽器中輸入您的服務器IP地址,例如 http://your_server_ip:5050
,然后按照提示完成設置。使用您在配置文件中設置的PostgreSQL憑據登錄。
請注意,上述鏈接和版本可能會隨著時間的推移而發生變化。請確保下載適用于您的系統的最新版本。