centos中下载和安装PostgreSQL
PostgreSQL官方下载地址:
https://www.postgresql.org/download/
1、选择linux,再选择Red Hat/Rocky/CentOS
2、进入CentOS对应的PostgreSQL选择页
https://www.postgresql.org/download/linux/redhat/
3、选择需要和对应的PostgreSQL版本
我这里选的是PostgreSQL10,CentOS7和x86_64位。
得到安装命令,并复制出来。
[code lang="cpp"]
# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install PostgreSQL:
sudo yum install -y postgresql10-server
# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
[/code]
根据复制得到的命令,一条一条地安装就可以了。
https://www.postgresql.org/download/
1、选择linux,再选择Red Hat/Rocky/CentOS
2、进入CentOS对应的PostgreSQL选择页
https://www.postgresql.org/download/linux/redhat/
3、选择需要和对应的PostgreSQL版本
我这里选的是PostgreSQL10,CentOS7和x86_64位。
得到安装命令,并复制出来。
[code lang="cpp"]
# Install the repository RPM:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install PostgreSQL:
sudo yum install -y postgresql10-server
# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10
[/code]
根据复制得到的命令,一条一条地安装就可以了。
精选留言