FATAL: no pg_hba.conf entry for host ::1

If you’re getting an error trying to connect to Postgres on localhost, the problem is probably that your system is configured for ipv6 but your Postgres isn’t. You can change this however.

First off, you need to find the pg_hba.conf file.

locate pg_hba.conf

Edit it and find the line which defines the localhost.

hosts  all all   md5

Below it, add the following line.

host all all ::1/128 trust

Finally, restart Postgres.

Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

Tags: , ,

This entry was posted on Thursday, October 11th, 2012 at 12:39 pm and is filed under Life, Tech. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.