Re: postgres 12 password failure port 5433 - Mailing list pgsql-novice

From Zahid Rahman
Subject Re: postgres 12 password failure port 5433
Date
Msg-id CAPGSW3QFh2GcKUAfL68YZ80vh28COeykGtdDdDdr3sFh+9YDOg@mail.gmail.com
Whole thread Raw
In response to postgres 12 password failure port 5433  (Zahid Rahman <zahidr1000@gmail.com>)
Responses Re: postgres 12 password failure port 5433  (Zahid Rahman <zahidr1000@gmail.com>)
List pgsql-novice
This is my ubuntu terminal prompt with root username.

kub18@UB18:~

I then types 
kub18@UB18:~$ su - postgres
Password:
postgres@UB18:~$ 
As you can see the password for user 'postgres' have been accepted and the prompt has changed.

I then typed:
postgres@UB18:~$ psql -p 5433 -h localhost
i am then prompted for postgres password

Password for user postgres:

I then typed password
the error message 
psql: error: could not connect to server: FATAL:  password authentication failed for user "postgres"
FATAL:  password authentication failed for user "postgres"

result of  sudo cat /etc/postgresql/12/main/pg_hba.conf
I have not included the comment header.

# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

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


On Sun, 15 Dec 2019, 15:34 Arlindo Neto, <neto.acs@gmail.com> wrote:
Are you lagged in as postgres user or root? You need to be logged in as postgres in order to use psql.

Just ‘su - postgres’ as root and try to use psql again.
If it still doesn't work, send us your /etc/postgresql/11/main/pg_hba.conf 

On Sun, 15 Dec 2019 at 12:19 Zahid Rahman <zahidr1000@gmail.com> wrote:
Hi,
I have postgres 10 running on 5432 and pgadmin is connecting  ok.

 I have just installed postgres 12 on ubuntu 18.04  using apt-get install
I have the following  success messages (see below)
I have verified that I have a database running at 5433 programmatically.
The PGADMIN4 "postgres admin tool" is giving an error "UNAUTHORISED message (see below)

WHEN i TRY TO LOGIN USING  PSQL CONSOLE using command line

psql -U postgres  -p 5433 -h localhost

I get an password  error message psql: error: could not connect to server: FATAL:  password authentication failed for user "postgres"

FATAL:  password authentication failed for user "postgres"

Unauthorized

The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.







Success. You can now start the database server using:
pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5433 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log






pgsql-novice by date:

Previous
From: Zahid Rahman
Date:
Subject: postgres 12 password failure port 5433
Next
From: Zahid Rahman
Date:
Subject: Re: postgres 12 password failure port 5433