PostgreSQL
安装
mkdir /app/postgresql && cd /app/postgresqlyum -y updatesudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpmsudo yum install -y postgresql15-serversudo /usr/pgsql-15/bin/postgresql-15-setup initdb sudo systemctl enable postgresql-15 sudo systemctl start postgresql-15su - postgrespsqlALTER USER postgres WITH PASSWORD '新密码';\qexitfind / -name postgresql.conf[root@VM-8-17-centos postgresql]# find / -name postgresql.conf /var/lib/pgsql/15/data/postgresql.confvim /var/lib/pgsql/15/data/postgresql.conflisten_addresses = '*' # 允许所有IP连接 port = 5432 # 默认端口find / -name pg_hba.confvim /var/lib/pgsql/15/data/pg_hba.conf[root@VM-8-17-centos postgresql]# find / -name pg_hba.conf /var/lib/pgsql/15/data/pg_hba.conf# IPv4 local connections: host all all 0.0.0.0/0 scram-sha-256firewall-cmd --zone=public --add-port=5432/tcp --permanent systemctl restart firewalldsudo systemctl restart postgresql-15systemctl status postgresql-15 systemctl stop postgresql-15 systemctl restart postgresql-15
最后更新于
这有帮助吗?