我已经成功安装了 postgresql 并在 Windows 10 中添加了我的环境变量的路径。但问题是当我尝试运行时 psql postgresql
在命令提示符下,它给出了错误提示
C:\Users\adity>psql postgres
Password for user adity:
psql: error: could not connect to server: FATAL: password authentication failed for user "adity"
我 100% 确定我的密码是正确的我已经尝试重新安装和卸载很多次,以防我错过了密码,但每次都给我同样的错误。虽然当我尝试从 GUI 运行时它开始运行。这令人沮丧,我不确定问题是什么。
最佳答案
在数据库集群创建过程中创建的数据库 super 用户很可能被称为 postgres
.
因此,与其使用默认值,即使用名称与您当前操作系统用户相同的数据库用户,不如明确指定数据库用户 postgres
:
psql -U postgres
关于windows - psql : error: could not connect to server: FATAL: password authentication failed for user,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59210032/