當前位置:外匯行情大全網 - 期貨行情 - 如何在虛擬機中安裝PostgreSQL數據庫?

如何在虛擬機中安裝PostgreSQL數據庫?

配置對應於PostgreSQL的yum源。

使用命令:dnfunstall-y https://download。PostgreSQL.org/pub/repos/yum/repospms/El-8-x86 _ 64/pgdg-red hat-reposo-latest . no arch . rpm獲取yum配置文件。

安裝對應於PostgreSQL13的rpm包。

壹般來說,PostgreSQL需要安裝的包包括:

依賴庫包:postgresql13-libs.x86_64

模塊&;分布式:PostgreSQL 13-contrib . x86 _ 64

客戶端:postgresql13.x86_64

服務器:PostgreSQL 13-server . x86 _ 64

創建postgres用戶和組組添加postgres創建postgres組?

Useradd -g postgres創建postgres用戶。

初始化數據庫

安裝postgresql數據庫後,默認的數據目錄是:/var/lib/pgsql/10/data/。但在實際操作中,我們必須為postgresql數據庫指定壹個專用的數據路徑。

1.創建指定的路徑

mkdir -p /data/pgdata

2.修改pgdata的所有者。

chown postgres /data/pgdata

3.切換到postgres用戶。

su - postgres?

4.初始化postgres數據庫實例。

/usr/pgsql-13/bin/init db-D/data/pg data

安裝在這裏完成。

  • 上一篇:鑫存管錢如何轉出_保證金余額是什麽_要怎麽開通
  • 下一篇:鹽湖鉀肥今天怎麽了,5月7日
  • copyright 2024外匯行情大全網