返回 Bug 清单
BUG-0188project-09低已修复config-defaults

Windows PostgreSQL 默认用户不匹配

发现:2026-09-30验证:2026-10-27置信度:85%

症状

Windows 本地 PostgreSQL 连接失败: ``` FATAL: password authentication failed for user "chemindra" ```

根因

项目初始面向 Docker 环境(`docker-compose.yml` 中 `POSTGRES_USER=chemindra`)开发,默认 `database_url` 写死 `postgresql+psycopg2://chemindra:chemindra_dev@localhost:5432/chemindra`。但 Windows 本机 PostgreSQL(官方安装器/Chocolatey)默认创建 `postgres` 用户,不存在 `chemindra` 用户。

修复方案

(`commit 1d6a90d`): - 默认 `database_url` 改为 `postgresql+psycopg2://postgres@localhost:5432/chemindra` - `.env.example` 相应更新,并添加注释说明 Docker 用户如何切换回 `chemindra` - `scripts/setup_local_db.ps1` 自动写入正确的 Windows 本地连接串

修复命令

(`commit 1d6a90d`):
- 默认 `database_url` 改为 `postgresql+psycopg2://postgres@localhost:5432/chemindra`
- `.env.example` 相应更新,并添加注释说明 Docker 用户如何切换回 `chemindra`
- `scripts/setup_local_db.ps1` 自动写入正确的 Windows 本地连接串

错误签名

FATAL: password authentication failed for user "chemindra"

技术信息

来源项目

project-09

涉及文件

apps/server/app/core/config.py, .env.example

标签

config-defaults, project-09