在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版本的不同而略有差异。建议参考官方文档以获取最准确的信息。