Fix “authentication failed” using postgreSQL with PHP PDO

While writing some PHP code, I was facing authentication issue trying to connect to postgreSQL db with PHP PDO …

Checking postgreSQL postgreSQL log file entries

Then when I load the PHP script in my browser

Here’s the solution

First, modify your pg_hba.conf file

# vim /var/lib/pgsql/data/pg_hba.conf

and add a line (see below)

and reload postgreSQL service

2 Responses

  1. Nice Article !
    This is my pleasure to read your article.
    Really this will help to people of PostgreSQL Community.

    I have also prepared one article about, Error: Password authentication failed for “Postgres” user in PostgreSQL.
    You can also visit my article, your comments and reviews are most welcome.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to Top