简体   繁体   English

django.db.utils.OperationalError:致命:用户“postgres”的密码认证失败

[英]django.db.utils.OperationalError: FATAL: password authentication failed for user "postgres"

Please help!请帮忙!

File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  password authentication failed for user "postgres"

My settings are local all all @authmethodlocal@我的设置都是本地所有@authmethodlocal@

It's like I can't get into my user "postgres" or "ladonna".这就像我无法进入我的用户“postgres”或“ladonna”。

I was running python3 manage.py runserver我正在运行 python3 manage.py runserver

local host, 5432, etc are default本地主机、5432 等是默认值

The user postgres has no DB password by default.默认情况下,用户 postgres 没有数据库密码。 So, Check the file /etc/postgresql/10/main/pg_hba.conf: And change it to因此,检查文件 /etc/postgresql/10/main/pg_hba.conf: 并将其更改为

local   all         postgres                          peer

Or Inside the psql shell you can set the password for user postgres或者在 psql shell 中,您可以为用户 postgres 设置密码

ALTER USER postgres PASSWORD 'yourPassword';

After setting password, add password in django settings for user postgres.设置密码后,在django设置中为用户postgres添加密码。

this error is not due to django this error is coming from postgresql and its sayig that connection is failing to the server due to password authentication failed.. so check the password of the user you are entering.in django settings.py if this doesn't work sometimes you have to make some changes in pg_hba.conf file....you can search them in link这个错误不是由于 django 这个错误来自 postgresql 并且它说由于密码身份验证失败,连接到服务器失败..所以检查你输入的用户的密码。在 django settings.py 如果这不是'有时您必须在 pg_hba.conf 文件中进行一些更改....您可以在链接中搜索它们

Visit https://manuals.xtuple.com/prodguide/admin-guide/ch01s12s01s01.html访问https://manuals.xtuple.com/prodguide/admin-guide/ch01s12s01s01.html

if this dont work you can check your port on which this is working.如果这不起作用,您可以检查您的端口。 by command sudo netstat -plunt |grep postgres通过命令sudo netstat -plunt |grep postgres

and change the port in your settings.py并更改 settings.py 中的端口

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 django.db.utils.OperationalError:致命:用户“vagrant”的密码验证失败 - django.db.utils.OperationalError: FATAL: password authentication failed for user “vagrant” 如何在Pycharm Windows中解决“django.db.utils.OperationalError:FATAL:密码认证失败的用户”Oeloun-pc“”? - How to solve “ django.db.utils.OperationalError: FATAL: password authentication failed for user ”Oeloun-pc“ ” in Pycharm Windows? Django 错误:django.db.utils.OperationalError:致命:用户对等身份验证失败 - Django error: django.db.utils.OperationalError: FATAL: Peer authentication failed for user django.db.utils.OperationalError:严重:用户“ deadlylaid”的对等身份验证失败 - django.db.utils.OperationalError: FATAL: Peer authentication failed for user “deadlylaid” 将 Django 连接到 Postgres:django.db.utils.OperationalError:致命:数据库“DATABASENAME”不存在 - Connecting Django to Postgres: django.db.utils.OperationalError: FATAL: database "DATABASENAME" does not exist 姜戈; django.db.utils.OperationalError: 致命: 没有主机、用户、数据库的 pg_hba.conf 条目 - Django; django.db.utils.OperationalError: FATAL: no pg_hba.conf entry for host, user, database django.db.utils.operationalError: (2059,“身份验证插件'caching_sha2_password'”) - django.db.utils.operationalError: (2059,“Authentication Plugin 'caching_sha2_password'”) Django 迁移:django.db.utils.OperationalError:(1824,“无法打开引用表‘classroom_user’”) - Django migration: django.db.utils.OperationalError: (1824, "Failed to open the referenced table 'classroom_user'") django.db.utils.OperationalError: (1045: Access denied for user 'root'@'localhost' (using password: NO) - django.db.utils.OperationalError: (1045:Access denied for user 'root'@'localhost' (using password: NO) 获取 django.db.utils.OperationalError: no such table With a Custom User Model - Getting a django.db.utils.OperationalError: no such table With a Custom User Model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM