在CentOS系統下使用pgAdmin管理PostgreSQL數據庫,可以按照以下步驟進行:
sudo yum update -y
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql15-server postgresql15-devel
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
sudo firewall-cmd --permanent --add-service=postgresql
sudo firewall-cmd --reload
sudo yum install -y gcc make readline-devel zlib-devel
sudo yum install -y pgadmin4
sudo systemctl start pgadmin4
sudo systemctl enable pgadmin4
/etc/httpd/conf.d/pgadmin4.conf
(對于Web模式):sudo cp /etc/httpd/conf.d/pgadmin4.conf.sample /etc/httpd/conf.d/pgadmin4.conf
sudo vi /etc/httpd/conf.d/pgadmin4.conf
加入以下內容:
VirtualHost *:80
ServerName pgadmin.cn
sudo systemctl restart httpd
請注意,以上步驟可能因CentOS版本和PostgreSQL版本的不同而略有差異。建議參考官方文檔以獲取最準確的信息。