CentOS 8 安装pgsql14
时间: 2023-10-15 10:27:01 浏览: 200
好的,以下是在 CentOS 8 上安装 PostgreSQL 14 的步骤:
1. 添加 PostgreSQL 官方仓库
```shell
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```
2. 安装 PostgreSQL 14
```shell
sudo dnf install -y postgresql14-server postgresql14-contrib
```
3. 初始化数据库
```shell
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
```
4. 启动 PostgreSQL
```shell
sudo systemctl start postgresql-14
```
5. 设置开机自启
```shell
sudo systemctl enable postgresql-14
```
现在,你已经成功在 CentOS 8 上安装了 PostgreSQL 14。
相关问题
centos8 安装pgsql14
好的,以下是在 CentOS 8 上安装 PostgreSQL 14 的步骤:
1. 添加 PostgreSQL 官方仓库
```shell
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```
2. 安装 PostgreSQL 14
```shell
sudo dnf install -y postgresql14-server postgresql14-contrib
```
3. 初始化数据库
```shell
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
```
4. 启动 PostgreSQL
```shell
sudo systemctl start postgresql-14
```
5. 设置开机自启
```shell
sudo systemctl enable postgresql-14
```
现在,你已经成功在 CentOS 8 上安装了 PostgreSQL 14。
centos7安装pgsql
您可以使用以下步骤在CentOS 7上安装PGSQL:
1. 首先,您需要安装PGSQL的yum源。您可以通过以下命令安装yum源:
```
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
```
2. 安装PGSQL数据库程序。您可以使用以下命令安装:
```
sudo yum install -y postgresql12-server
```
3. 创建数据库实例。如果您没有设置路径,默认情况下数据库实例的数据将存储在`/var/lib/pgsql/12/data`目录下。您可以使用以下命令初始化数据库实例:
```
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
```
4. 配置开机自启。您可以使用以下命令设置PGSQL服务开机自启:
```
sudo systemctl enable postgresql-12
```
5. 启动PGSQL服务。您可以使用以下命令启动PGSQL服务:
```
sudo systemctl start postgresql-12
```
通过以上步骤,您就可以在CentOS 7上成功安装和启动PGSQL数据库了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [centOS离线安装pgsql-12](https://download.csdn.net/download/The_Strain/13642707)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [PgSQL安装部署(centos 7)](https://blog.csdn.net/weixin_43486817/article/details/117663032)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [在centOS7上安装postgresql](https://blog.csdn.net/weixin_46732884/article/details/124050982)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文
相关推荐
















