psql:致命:用户密码验证失败" postgres"

时间:2018-05-30 14:29:47

标签: postgresql

我使用的是Windows 10,刚刚安装了PostgreSQL 10.4。 现在我的超级用户是postgres,我必须创建一个新用户。我在cmd上使用了以下命令: -

psql -U postgres -c "CREATE ROLE gautam LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;" mydb

,错误是

C:\Users\Gautam Jajoo>psql -U postgres psql: FATAL: password authentication failed for user "postgres" password retrieved from file "C:\Users\Gautam Jajoo\AppData\Roaming/postgresql/pgpass.conf"

任何人都可以告诉它可能的解决方案!!

1 个答案:

答案 0 :(得分:0)

添加-W参数以提示输入密码

psql -U postgres -c -W "CREATE ROLE gautam LOGIN NOSUPERUSER INHERIT CREATEDB CREATEROLE;" 

您可以使用http://cmder.net在Windows中使用cmd

相关问题