Django3.0 设置postgresql 12 连接错误

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行以下的内容修改成如上内容即可!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容