# PMM installation problem om Postgres

**URL:** <https://forums.percona.com/t/pmm-installation-problem-om-postgres/25802>\
**Category:** PMM 2.x\
**Tags:** pmm, postgres, closed-no-reply\
**Created:** [October 10, 2023, 9:02am UTC](https://forums.percona.com/t/pmm-installation-problem-om-postgres/25802 "2023-10-10T09:02:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgeny\_Lyndin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/evgeny_lyndin/32/13217_2.png) [@Evgeny\_Lyndin](https://forums.percona.com/u/Evgeny_Lyndin)\
**Post date:** [October 10, 2023, 9:02am UTC](https://forums.percona.com/t/pmm-installation-problem-om-postgres/25802/1 "2023-10-10T09:02:51Z")

</div>

## Description:

Hello, we are using Postgres version 14.9.  
According to the official documentation ([Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/postgresql.html#create-a-database-account-for-pmm)) we created a superuser, added a rule in pg\_hba.con, we restarted the postgres service, but after the command psql postgres pmm -c “\conninfo” we get the error psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL : Peer authentication failed for user “pmm”

## Steps to Reproduce:

1. Create a user. This example uses `pmm`. (Replace ` ****** ` with a strong password of your choice.)

```auto
CREATE USER pmm WITH SUPERUSER ENCRYPTED PASSWORD ' ******';

```

1. PMM must be able to log in locally as this user to the PostgreSQL instance. To enable this, edit the `pg_hba.conf` file. If not already enabled by an existing rule, add:

```auto
local all pmm md5
# TYPE DATABASE USER ADDRESS METHOD

```

1. Reload the configuration:

```auto
su - postgres
psql -c "select pg_reload_conf()"

```

**And additionaly we run systemctl restart postresql**

## Version:

Postgres v14.9.  
pmm-admin v2.40.0

## Expected Result:

“Enter the password for the `pmm` user when prompted.”

## Actual Result:

psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL : Peer authentication failed for user “pmm”

## Additional information

**\du:**  
Role name | Attributes | Member of | Description  
---------------±-----------------------------------------------------------±-------------±------------  
foiv\_readonly | | {readaccess} |  
foiv\_user | | {} |  
pmm | Superuser | {} |  
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {} |  
readaccess | Cannot login | {} |  
replication | Replication | {} |

**pg\_hba.conf:**  
local all postgres peer  
TYPE DATABASE USER ADDRESS METHOD

“local” is for Unix domain socket connections only  
local all all peer  
IPv4 local connections:  
host all all 127.0.0.1/32 scram-sha-256  
IPv6 local connections:  
host all all ::1/128 scram-sha-256  
Allow replication connections from localhost, by a user with the  
replication privilege.  
local replication all peer  
host replication all 127.0.0.1/32 scram-sha-256  
host replication all ::1/128 scram-sha-256  
host replication replication 10.128.0.27/32 scram-sha-256

host all foiv\_user 10.128.0.0/24 md5  
host all foiv\_readonly 10.128.0.0/24 md5  
local all pmm md5
