Re: postgres 12 password failure port 5433

From: Zahid Rahman <zahidr1000(at)gmail(dot)com>
To: Arlindo Neto <neto(dot)acs(at)gmail(dot)com>, pgsql-novice(at)lists(dot)postgresql(dot)org
Subject: Re: postgres 12 password failure port 5433
Date: 2019-12-15 16:10:08
Message-ID: CAPGSW3QFh2GcKUAfL68YZ80vh28COeykGtdDdDdr3sFh+9YDOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

This is my ubuntu terminal prompt with root username.

kub18(at)UB18:~

I then types

*kub18(at)UB18:~$ su - postgresPassword:postgres(at)UB18:~$ *
As you can see the password for user 'postgres' have been accepted and the
prompt has changed.

I then typed:
postgres(at)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(dot)acs(at)gmail(dot)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(at)gmail(dot)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 localhostI 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
>>
>>
>>
>>
>>
>>
>>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Zahid Rahman 2019-12-15 16:24:08 Re: postgres 12 password failure port 5433
Previous Message Zahid Rahman 2019-12-15 15:18:37 postgres 12 password failure port 5433