FATAL: password authentication failed for user “postgres”
说明 Alembic 在尝试连接 PostgreSQL 数据库时,用户名是 postgres,但密码不正确,导致连接失败。
检查密码的方式
方法 1:直接用 psql 登录测试
psql -U postgres -h localhost -p 5432
系统会提示你输入密码,你可以尝试各种密码(默认可能是 postgres
、123456
、留空等)。
方法 2:重设 postgres 密码(如果你有权限)
ALTER USER postgres WITH PASSWORD ‘new_password’;