Pgadmin3: FATAL: identifier authentication failed for user "postgres"

I am trying to register a new server in pgadmin3 with the following settings:

Name: postgres
Host: localhost
Username: postgres
Password: <password which works for psql>
Service: empty or postgres

But it shows an error:

FATAL: Ident authentification failed for user "postgres"

I restarted the postgresql service, but to no avail.

The contents of / var / lib / pgsql / data / pg_hba.conf:

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               ident

EDIT: Tools → Server Configuration → pg_hba.conf is grayed out.

+5
source share
3 answers

It seems that PgAdmin-III, probably, is connected via IPv6 by default, so it uses a string ident, which corresponds to an IPv6 address for localhost, ::1/128.

If you want to use password authentication, you probably want to:

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

, ​​ unix, trust, , , , , . ident ( , unix , Pg) md5 ( UNIX-).

pg_hba.conf , PgAdmin-III . PgAdmin-III postgres sudo, (, , ) nano pg_hba.conf.

psql, psql , , unix, trust. , , psql, , , , .

+4

, - pgadmin. , .

sudo -u postgres psql

, postgres.

psql .

\password

.

+2

PostGreSQL ( Linux):

  • , ( , ).
  • , .
  • , , - /var/lib/pgsql/data​​strong > . -/var/lib/pgsql/unrelated-instance. postgres, , (-D ).
  • pg_hba.conf . , postgres.
  • , , . IPV4, IPV6.
  • .
  • , . 5-7, .
  • Important Do not stop! You should now set up a more secure password - postgres might be good for quick local setup, but you want to use a more secure, custom authentication mechanism such as LDAP, Kerberos, or GSSAPI. In addition, you want to make sure that you enable SSL.
0
source

All Articles