【问题标题】:psql: FATAL: password authentication failed for user "icinga"psql:致命:用户“icinga”的密码验证失败
【发布时间】:2017-12-16 21:48:37
【问题描述】:

我正在尝试在 CentOS7 上设置 Icinga 2,并按照官方文档中的说明进行操作。 [https://docs.icinga.com/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest/doc/module/icinga2/chapter/getting-started][1].I 已将数据库和用户创建为 icinga。我面临以下问题 psql: FATAL: password authentication failed for user "icinga" when trying to import the Icinga 2 IDO schema using the following commands

   export PGPASSWORD=icinga and psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql

下面是我正在使用的 pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# icinga
local   icinga      icinga                            md5
host    icinga      icinga      127.0.0.1/32          md5
host    icinga      icinga      ::1/128               md5
# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

【问题讨论】:

    标签: postgresql psql icinga icinga2 icingaweb2


    【解决方案1】:

    尝试改变

    local   all             all                                     peer
    

    到:

    local   all             all                                     md5
    

    【讨论】:

      【解决方案2】:

      在 Ubuntu Bionic 上遇到同样的问题,可以通过显式添加 localhost 作为主机来解决:

      export PGPASSWORD=icinga
      psql -U icinga -d icinga -h localhost < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql
      

      【讨论】:

        猜你喜欢
        • 2013-11-15
        • 1970-01-01
        • 2015-09-10
        • 1970-01-01
        • 1970-01-01
        • 2021-06-16
        • 1970-01-01
        • 2017-02-06
        • 2023-04-05
        相关资源
        最近更新 更多