Django3.0 设置postgresql 12 连接错误

2020-02-15  本文已影响0人  玩互丧智

conn = _connect(dsn, connection_factory=connection_factory, **kwasync)django.db.utils.OperationalError: FATAL: Ident authentication failed for user "postgres"

在python manage.py makemigrations命令出现错误,这种错误主要是postgresql权限的问题,简单的解决办法是设置/var/lib/pgsql/12/data/pg_hba.conf 文件。

local all postgres trust 

host all all 127.0.0.1/32 trust

host all all ::1/128 trust

local replication all trust

host replication all ::1/128 trust

把文件第80行以下的内容修改成如上内容即可!

上一篇下一篇

猜你喜欢

热点阅读