django - Django 收到“FATAL: password authentication failed for user”,即使用户 crendntical 是正确的
问题描述
一些背景知识:我正在尝试在 Windows 上安装拱门项目。在一些问题之后,我看到建议在 Linux 上运行它,所以现在我在 Windows 的 Ubuntu 终端上运行。
至于报错:第一步是运行python manage.py setup_db
命令。它失败了:
FATAL: password authentication failed for user "kali"
Error connecting to db with these settings: dbname=jerarch user=kali host=localhost port=5432
Have you created the database yet? The quickest way to do so is to supply Postgres superuser credentials in the PG_SUPERUSER and PG_SUPERUSER_PW settings, and then re-run this same command.
还:
- 用户“kali”存在,我已经使用
ALTER USER kali WITH PASSWORD 'xxxxxxxx';
psql -U kali -d jerarch
工作正常,只有我之前设置的密码(意思是ALTER USER
工作)。PG_SUPERUSER
并PG_SUPERUSER_PW
根据需要进行定义。
我真的不知道还能做什么。谢谢
解决方案
所以就在发布问题之前,我发现问题在于重复的postgresql
环境:一个在我的 Windows 上运行,另一个在虚拟 Ubuntu 上运行。
使用 Ubuntu clipsql
解决了 Ubuntu postgres,而出于某种原因djnago
在 Ubuntu 上解决了 Window 的 postgres。kali
用户也在那里配置,但使用了另一个密码。
推荐阅读
- nginx - Nginx Conf 冲突 www 502
- symfony - 如何在 Doctrine 上自定义 FOREIGN KEY 消息?API平台
- python - Docker MYSQL [2003] 无法连接到 MySQL 服务器(111 连接被拒绝)
- javascript - 如何使用 onClick 事件渲染一些 JSX?
- javascript - 无法从 Firebase 检索日期
- python - 终端的 Python 彩色文本
- python - 如何在python中的多个字典列表中查找项目的累积总和
- keycloak - 如何在keyclaok中将子组添加到现有组:找不到404
- javascript - 图表 js 有时找不到 id
- numpy - 内存中的张量流馈送图像