centos7安装pgsql
时间: 2023-10-17 11:27:48 浏览: 105
centos下php安装pgsql和pdo_pgsql扩展,这是另一种方法,很简便,用.so文件来安装
5星 · 资源好评率100%
您可以使用以下步骤在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 ]
阅读全文