psql: FATAL: Ident authentication failed for user "username" Error and Solution
psql -d myDb -U username -WIt gives me an error that read as follows:
psql: FATAL: Ident authentication failed for user "username"How do I fix this error?
A. To fix this error open PostgreSQL client authentication configuration file /var/lib/pgsql/data/pg_hba.conf :
# vi /var/lib/pgsql/data/pg_hba.conf
This file controls:
- Which hosts are allowed to connect
- How clients are authenticated
- Which PostgreSQL user names they can use
- Which databases they can access
local all all trust host all 127.0.0.1/32 trustSave and close the file. Restart Postgresql server:
# service postgresql restart
Now, you should able to login using following command:
$ psql -d myDb -U username -W
credit : http://www.cyberciti.biz/faq/psql-fatal-ident-authentication-failed-for-user/
No comments:
Post a Comment