【问题标题】:Problem installing PostgreSQL 12 on CentOS 8在 CentOS 8 上安装 PostgreSQL 12 时出现问题
【发布时间】:2020-09-23 01:09:54
【问题描述】:

安装 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 centos centos8 postgresql-12


【解决方案1】:

您只在服务器上安装了 PostgreSQL 客户端应用程序。为了安装服务器软件,您需要安装满足这些包依赖关系的postgresql-server 包。之后,您可以按照此文档继续配置、配置和维护您的新数据库。

https://www.postgresql.org/download/linux/redhat/

正如您最初提到的,这个要点很简单:

  postgresql-setup initdb
  systemctl enable postgresql.service --now

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-08-07
    • 1970-01-01
    • 2011-09-18
    • 1970-01-01
    • 2021-05-27
    • 2021-06-11
    • 2010-11-18
    • 1970-01-01
    相关资源
    最近更新 更多