Postgres says my password is invalid

Doug Easterbrook doug at artsman.com
Sat Jan 29 18:36:02 UTC 2022


Something must have changed.   things never stop working for no reason - there is always a root cause.

1) open activity monitor and look for processes called ‘postgres’ in all processes .  That will tell you if postgres is up.  if not, do one of the following:
a) use the.                    /library/postgresql/14/bin/pg_ctl -start 
command to get postgres running.  
b) restart your machine.

2) if postgres is running, can you connect with your application?   if not, and you cannot connect with pgadmin, then I highly suspect that something was edited in the 

pg_hba.conf .. you it might help to see the bottom of it.  Mine looks something like this.

you can always make the local connection and ::1/128  (which pgadmin uses) as ’trust’.   that means don’t bother with passwords on the local machine.    For that matter, you can make the 127.0.0.1/32 connection as ’trust’ as well.    

it is not wise in a production environment to use ‘trust’ and do away with the requirement for passwords — but in development, it can be nice to get you out of a bind.


# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             192.168.0.0/16          scram-sha-256
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     scram-sha-256
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256


if you change pg_hba.conf —  then reload the server parameters

/library/postgresql/14/bin/pg_ctl -reload




3) postgresql.conf — did you edit that recently and make a mistake in it?


4) did you change the permissions of the data directory ??   if so, postgres won’t start







Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On January 29, 2022, at 10:00 AM, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> The second part of the failed message says 127.0.0.1 is failing too. So I don’t think changing to that will work. Plus I don’t know WHERE to change to 127.0.0.1 as the IP it try’s on. :-(
> 
> Why did it all work the first time, and now after 2 reinstalls it’s not working. I don’t change anything. 
> 
> 
> 
>> On Jan 29, 2022, at 12:41 PM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>> 
>> try 127.s as the server ip.
>> 
>> 
>> localhost ::1  is not an ip address (as far as I know - but I don’t play ipv6 much).
>> 
>> ::1 is ipv6           for 127.0.0.1
>> localhost is ipv4 for 127.0.0.1
>> combining them likely isn't valid.   see wikipedia https://en.wikipedia.org/wiki/Localhost
>> 
>> 
>> 
>> if you want to see what the server is rejecting, you can look at the /Library/Postgresql/14/data/log folder and  — look at the latest log file to see what it is saying.    
>> 
>> 
>> 
>> Doug Easterbrook
>> Arts Management Systems Ltd.
>> mailto:doug at artsman.com
>> http://www.artsman.com
>> Phone (403) 650-1978
>> 
>>> On January 29, 2022, at 9:27 AM, Das Goravani <goravanis at gmail.com> wrote:
>>> 
>>> 
>>> Doug, 
>>> 
>>> I use the same password for both. 
>>> 
>>> In the meantime I reinstalled.
>>> 
>>> Now on the second password, and I just reinstalled, it is saying 
>>> 
>>> Connection to server at localhost ::1 port 5432 failed: Connection refused. Is the server running on that host and accepting TCP/IP connections?
>>> 
>>> I just rebooted too. 
>>> 
>>> This all was working. On the first install, then it just decided to not recognize my password.
>>> 
>>> Now I’ve reinstalled, and it is having the above problem.
>>> 
>>> I am clue less about what to do.
>>> 
>>> 
>>> 
>>>> On Jan 29, 2022, at 12:16 PM, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
>>>> 
>>>> there are two passwords on pgadmin
>>>> 
>>>> first one, to let you access the application.  you can reset that
>>>> 
>>>> second one is the password to a particular server cluster.   That is the postgres install password.
>>>> 
>>>> 
>>>> they are not necessarily the same.
>>>> 
>>>> 
>>>> reset the first one, then connect to your database cluster again.
>>>> 
>>>> 
>>>> Doug Easterbrook
>>>> Arts Management Systems Ltd.
>>>> mailto:doug at artsman.com
>>>> http://www.artsman.com
>>>> Phone (403) 650-1978
>>>> 
>>>>> On January 29, 2022, at 8:59 AM, Das Goravani <goravanis at gmail.com> wrote:
>>>>> 
>>>>> 
>>>>> Now I am distressed.
>>>>> 
>>>>> Now pgAdmin says Fatal error password authentication failed for postgres user.
>>>>> 
>>>>> It asks for your password as soon as you open pgAdmin
>>>>> 
>>>>> I have been using the password I input when I set it up and that has been working
>>>>> 
>>>>> Now today it says it doesn’t work
>>>>> 
>>>>> I didn’t change a thing, I didn’t change anything
>>>>> 
>>>>> Why would it do this?
>>>>> 
>>>>> What do I do? Do I have to reinstall postgres?
>>>>> 
>>>>> This is a drag.
>>>>> 
>>>>> Das
>>>>> _____________________________________________________________
>>>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
>>>> 
>>>> _____________________________________________________________
>>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
>>> 
>>> _____________________________________________________________
>>> Manage your list subscriptions at http://lists.omnis-dev.com
>>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list