psql:严重:用户Windows 8的密码身份验证失败 [英] psql: FATAL: password authentication failed for user windows 8

查看:144
本文介绍了psql:严重:用户Windows 8的密码身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上安装了postgresql,并在安装过程中要求为该帐户创建用户.这使我的计算机上有一个名为postgres的新Windows用户,我也为其创建了密码.

I installed postgresql on windows and while the installation it asks to make a user for the account.This made a new windows user in my computer called postgres, I have created a password for it as well.

现在,我想在Windows命令行上运行psql,它要求输入密码(不提及用户),并且始终将错误信息反馈给我:psql: FATAL: password authentication failed for user "Ash".即使我多次输入了帐户密码.

Now I want to run psql on windows command line, it asks for a password (without mentioning the user) and always gives me back the error: psql: FATAL: password authentication failed for user "Ash". Even though I have put my accounts password many times.

使用pgadmin,我将用户"postgres"更改为"Ash",但尚未重设密码.我在这里按照以下步骤操作:我忘记了在postgres期间输入的密码安装(我宁可键入host all 127.0.0.1/32 trust,因为我在Windows上),但是再次运行psql以便更改密码时出现错误:psql FATAL:could not load pg_hba.conf.全部.

using pgadmin I changed the user "postgres" to "Ash" but I have yet to remake the password. I followed the steps here: I forgot the password I entered during postgres installation (I rather types host all 127.0.0.1/32 trust because I am on windows), but when running psql again so that I can change the password I get the error: psql FATAL:could not load pg_hba.conf. All together.

为什么无法加载?我所做的就是添加一个额外的身份验证选项.

Why can it not load? All I did was add an extra authentication option.

此外,Windows用户与postresql用户是分开的还是相同的(彼此依赖)?

Also, is the windows user separated from a postresql user or are they the same(depend on each other)?

如您所见,它没有给我选择Aisha是否应为超级用户的选项.或与此相关的其他选择.

As you can see, it did not give me the option to choose if Aisha should be a superuser or not. or the other options for that matter.

我也使用了pgadmin |||创建一个新用户,但会弹出相同的错误:

I also used pgadmin||| to create a new user but the same error pops up:

该用户不存在,为什么要这样做?

The user does not exist so why does it do this?

推荐答案

createuser是命令行实用程序.在psql中的SQL级别上使用CREATE USER username WITH PASSWORD 'fred';或类似的名称.注意分号.

createuser is a command-line utility. Use CREATE USER username WITH PASSWORD 'fred'; or similar at the SQL level in psql. Note the semicolon.

您在屏幕快照中所做的工作是开始编写一个以createuser开头的SQL命令,但由于没有分号终止符,因此从未将其发送到服务器以运行.因此,您永远不会收到错误消息,告诉您这样做是没有道理的.

What you're doing in your screenshot is starting to write an SQL command beginning with createuser, but never sending it to the server to run because there's no semicolon terminator. So you never get the error that would tell you it doesn't make sense to do that.

这篇关于psql:严重:用户Windows 8的密码身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆