pgadmin3: FATAL: Ident authentification failed for user "postgres"
Solution 1
It looks like PgAdmin-III is probably connecting over IPv6 by default, so it's using the ident
line that matches the IPv6 address for localhost, ::1/128
.
If you want to use password authentication, you probably want:
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
I'm not sure why you have the unix domain socket line set to trust
, but that's probably OK if it's just a development machine, so leave it unchanged. It's really much safer to have it as ident
(if you want the unix user to have to be the same as the Pg user) or md5
(for password auth on local unix sockets) though.
You'll need to edit pg_hba.conf
directly in a text editor if PgAdmin-III doesn't have permissions to edit it. You could run PgAdmin-III as user postgres
via sudo
, but it's way safer (and probably easier) to just use nano
or a similar command-line text editor to modify pg_hba.conf
.
The password works for psql
because psql
will, unless told otherwise, connect over a unix domain socket, and you have that set to trust
. You'll probably find you could give any password to psql
and it'll still work, because it's never being asked to actually give the password, it's just being automatically trusted.
Solution 2
Yes this type of error is seen by every newbie user to pgadmin. I have found this solution and it worked for me.
sudo -u postgres psql
This will ask for your system password and then you will get the postgres prompt.
and then in psql type below command to change the password.
\password
now enter the new password and re-enter it.
DSblizzard
Evgeny Luttsev. Mathematician (P vs NP), programmer (programming language design, natural language programming). Email: dsblizzard % gmail % com
Updated on June 21, 2022Comments
-
DSblizzard almost 2 years
I'm trying to register new server in pgadmin3 with following settings:
Name: postgres Host: localhost Username: postgres Password: <password which works for psql> Service: empty or postgres
But it shows error:
FATAL: Ident authentification failed for user "postgres"
I've restarted postgresql service, but to no avail.
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 greyed out.