I have installed postgresql database on Fedora 17.
When I create a new server connection through pgadmin3, I get this Error in a popup window:
postgresql The server doesn't accept the current user: The server report
Ident authentication failed
The server doesn't accept the current user: The server reports
FATAL: Ident authentication failed for user "pgadmin"
If this message appears, the pg_hba.conf entry found for your
client / user / database combination is set to "ident" authentication.
Some distributions, e.g. Debian, have this by default. To perform ident
based authentication successfully, you need additional setup; see the
PostgreSQL help for this. For a beginner, it might be more appropriate
to use a different authentication method; MD5 encrypted passwords are
a good choice, which can be configured by an entry in pg_hba.conf like
this:
host all all 192.168.0.0/24 md5
This example grants MD5 encrypted password access to all databases to
all users on the private network 192.168.0.0/24.
You can use the pg_hba.conf editor that is built into pgAdmin III to
edit the pg_hba.conf configuration file. After changing pg_hba.conf,
you need to trigger a server configuration reload using pg_ctl or by
stopping and restarting the server process.
I have made the change mentioned in the error message, I added host all all 192.168.0.0/24 md5
to the pg_hba.conf. But I still get the same error. What am I doing wrong?
Best Answer
The mistake I made was that I forgot to uncomment the other lines that set the host, and I didn't restart postgresql so that new changes to that file would take effect. Here are the steps I used:
Find your
pg_hba.conf
, mine is in/var/lib/pgsql/data/pg_hba.conf
Here are the original incorrect contents of
pg_hba.conf
, notice the two host lines for IPv4 and IPv6:I had to add these lines at the end of that file
If you don't comment out the other default lines here it won't work:
Then restart postgresql.
After restart, try again, and the error is fixed. Then I can login to the sever with pgadmin3.