Loading...
 
Skip to main content

Configure PostgreSQL to allow local connections

It may be necessary to configure the postgres daemon to allow connections from the localhost without authentification. This can be set by changing the configuration in the postgres file pg_hba.conf (tipically under /usr/local/pgsql/data or /etc/postgresql/*/main/pg_hba.conf, where * stands for a version number) and having two 'trust' lines like these in place of the 'ident' lines:

local all all trust

host all all 127.0.0.1 255.255.255.255 trust

and then restarting the postgres daemon with pg_ctl restart or service postgres restart or maybe service postgresql-* restart. Usually this has to be done as user 'postgres', or whatever system user created the posgres installation. It is not recommended to handle the postgress as 'root'.