美文网首页
Django3.0 设置postgresql 12 连接错误

Django3.0 设置postgresql 12 连接错误

作者: 玩互丧智 | 来源:发表于2020-02-15 14:51 被阅读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行以下的内容修改成如上内容即可!

    相关文章

      网友评论

          本文标题:Django3.0 设置postgresql 12 连接错误

          本文链接:https://www.haomeiwen.com/subject/uvaefhtx.html