Postgres says my password is invalid

Alex Clay aclay at mac.com
Sun Jan 30 17:16:19 UTC 2022


Hi Das,

Use the following command to switch to the postgres user:

> sudo su - postgres


You'll need to enter _your_ macOS password. From there, you are the postgres user and can use pg_ctl to inspect and control the server.

When you're finished working as the postgres user, run the command "exit" to close that session and return to your regular user's shell.

Alex

> On Jan 30, 2022, at 12:10, Das Goravani <goravanis at gmail.com> wrote:
> 
> 
> Here is my pg_hba file contents
> 
> # "local" is for Unix domain socket connections only
> local   all             all                                     scram-sha-256
> # IPv4 local connections:
> host    all             all             0.0.0.0/0               trust
> # 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
> 
> 
> As you can see I edited it to let everybody through. This worked on my first install of Postgres.
> 
> My first install went beautifully for awhile. Then it disconnected, I rebooted, and the error messages started. At first it would not recognize my password, which had worked up til then. Then it started with the error message on the second password window that it couldn’t connect to localhost.
> 
> Now I have reinstalled 2 more times. It is still doing the thing where it says it cannot connect to localhost. 
> 
> By the way I did see that on the second install it recommended port 5433 and I went with that.. only to find that internally it was still expecting 5432 so I installed again and this third time it went back to recommending 5432 and I went with that. So I am on 5432 now again.
> 
> By the way I am TRYING to start and stop the Postgres service with this command:
> 
> /Library/PostgreSQL/14/bin/pg_ctl -start
> 
> I have tried it with SUDO too.. 
> 
> It says pg_ctl cannot be run as root.
> “Please log in (using e.g., “su”) as the (unprivileged) user that will own the server process.”
> 
> What does that mean? I tried running it with SU in front of it but that came up with
> 
> Su: Sorry
> 
> And that’s all. It didn’t like me putting SU at the front of the command.
> 
> I am about to delete the system user it created named Postgres, delete the Postgres folder, reboot, then try to install again. This time not edit hba just see if I can use pgAdmin to get into the Servers to create a user and a database. 
> 
> The first time I installed, I was able to edit hba no problem, with nano, then I was able to log in from my network and using my public IP address.. all no problem.. first created a user and a database, and was able to log into those no problem from remote Mac. The first install thus went great. I am doing all the SAME things on these 2nd and 3rd installs with no go. 
> 
> I am about to do my fourth install. 
> 
> Why can I not run pg_ctl? To start and stop the service so that I don’t have to constantly restart my Mac server?
> 
> All help appreciated. 
> 
> Thank you,
> 
> Das goravani
> 
> 
> _____________________________________________________________
> 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