[英]Problem installing PostgreSQL 12 on CentOS 8
安裝 PostgreSQL 12:
sudo dnf install @postgresql:12
然后,contrib 包附加功能: sudo dnf install postgresql-contrib
之后,當我嘗試初始化 PostgreSQL 數據庫時:
sudo postgresql-setup initdb
我得到: sudo: postgresql-setup: command not found
另外,當我嘗試檢查狀態時:
sudo systemctl status postgresql
收到此錯誤: Unit postgresql.service could not be found.
我做錯了什么? 如果這種安裝方式不對,有沒有別的辦法在centos上安裝postgresql?
您只在服務器上安裝了 PostgreSQL 客戶端應用程序。 為了安裝服務器軟件,你需要安裝postgresql-server
包來滿足這些包的依賴。 之后,您可以按照本文檔繼續供應、配置和維護您的新數據庫。
https://www.postgresql.org/download/linux/redhat/
正如您最初提到的,其要點很簡單:
postgresql-setup initdb
systemctl enable postgresql.service --now
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.