readthefuckingmanual.net

[SOLVED] Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user

Error added: 2006-02-20T21:59:25Z

1 people waiting for the answer...

3 answers found.

Answer 760 (100.0% helpful)

The default security settings in PostgreSQL are very strict, as they should be.

1) If there\'s no host specified in your connection string then the \"local\" line can be changed to \"md5\" instead of \"ident sameuser\". The PostgreSQL server and web server must be running on the same computer for this to work.

2) If your connection string specifies a host, e.g. host=localhost, you can change the pg_hba.conf file to include a line that covers your IP address and has the method set to \"md5\".
For localhost connections you can edit the IPv4 line to use \"md5\" as method instead of \"ident sameuser\". To allow other computers on a certain subnet to access the server you can copy the IPv4 line but replace the 127.0.0.1/32 with something like 192.168.1.0/24 and use \"md5\".

Please note that this is probably not a good security practice and you should read further about PostgreSQL security if you want to run a server that\'s open to others but if you\'re only running locally for testing and development this should be enough in most cases.
Permalink

Answer 146 (60.0% helpful)

Change your pg_hba.conf to use some other type of authentication -- say, \'md5\' if you\'re going over a network, or \'trust\' if you want to open a security hole.
Permalink

Answer 531 (0.0% helpful)

The order is also important, so make sure the entry is above any default entry such as:
\"local   all   all    ident sameuser\"
as that seems to override any subsequent entries
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: