Closed sebastianhelbig closed 10 years ago
If anyone gets here, solution is simple
set host as null
, leave port as is (5432 by default), password as null
. Also note that pg_hba.conf
should be set to use peer
method.
.env
DB_HOST=/var/run/postgresql
DB_PORT=5432
then update /etc/postgresql/16/main/pg_hba.conf
to enable username-password authentication following https://superuser.com/questions/1692580/postgresql-unix-domain-socket-with-password-authentication:
# "local" is for Unix domain socket connections only
- local all all peer
+ local all all scram-sha-256
finally
sudo pg_ctlcluster 16 main reload
note: replace 16
with your running postgres server version
Host parameter accepts the directory of the unix domain socket. Option unix_socket as with mysql is not used in the postgres connector. The implemented solution to #1741 (just omitting the host parameter) does not solve the original problem but instead connects to localhost over tcp.