42๐
โ
Your pg_hba.conf
is configured to use โidentโ authentication for connections from localhost (127.0.0.1). You need it to be changed to md5
for your database and user combination.
๐คCraig Ringer
8๐
@Craig is right, have to update the authentication method of the database user in the file pg_hba.conf, here what Iโve done:
sudo nano /var/lib/pgsql/data/pg_hba.conf
Go to the bottom of the file, then change the method from ident to md5 on the IPv4 and IPv6 rows:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5 # <- here
# IPv6 local connections:
host all all ::1/128 md5 # <- and here
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
Happy Coding ๐
๐คMehady
2๐
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 trust < from ident to trust
# IPv6 local connections:
host all all ::1/128 trust < i changed this from ident to trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 ident
host replication all ::1/128 ident
Donโt forget to restart postgresql:
sudo systemctl restart postgresql
๐คchihab mg
0๐
Had the same Error, only to resolve in my case instead of md5
I used trust
. This is because 1) Django needs SELECT, INSERT, DELETE and UPDATE permissions and 2) using the postgres user does not require a password.
๐คDajuan Mcdonald
- Args and kwargs in django views
- Displaying both sides of a ManyToMany relationship in Django admin
- Django dynamic urls
- Can you declare multiple with variables in a django template?
Source:stackexchange.com