Ident authentication failed error when connecting to PostgreSQL via PgAdmin III

烈酒焚心 提交于 2019-12-12 19:14:32

问题


I'm trying to connect to my postgres server instance using PgAdmin III from the same machine the instance is on, but I keep getting the "Ident authentication failed" error when trying to connect. Here the steps I formed performed to try to achieve connectivity:

I created a new user in Postgres called 'pguser1': user pguser1

I modified my pg_hba.conf file in order to use md5 authentication: pg_hba.conf with md5 auth

I then tried to connect via pgAdminIII, but I've had no success.

What am I missing?

Thanks in advance.


回答1:


Did you create a md5 password for the user or update the user?

If not this may help

U=pguser1; P=yourpassword; echo -n md5; echo -n $P$U | md5sum | cut -d' ' -f1 

Which produces an md5 password. md575a63f65a68540d053ec41f410d9ab24

So the next step would be to update/create the user password .

CREATE USER theuser PASSWORD 'md575a63f65a68540d053ec41f410d9ab24'; 

OR

ALTER USER postgres password 'md575a63f65a68540d053ec41f410d9ab24'; 

You could then login with (in this case)

user pguser1 Password: yourpassword

All the best



来源:https://stackoverflow.com/questions/36973881/ident-authentication-failed-error-when-connecting-to-postgresql-via-pgadmin-iii

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!