Re: [pgsql-novice] Daily digest v1.3706 (6 messages)
От | Michael Convey |
---|---|
Тема | Re: [pgsql-novice] Daily digest v1.3706 (6 messages) |
Дата | |
Msg-id | CACbnAKZn_1z9+0WX5xpmnQ5QtL0zD536vaTtq7t6pc69ngnHHA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: [pgsql-novice] Daily digest v1.3706 (6 messages) (Alan Hodgson <ahodgson@simkin.ca>) |
Ответы |
Re: [pgsql-novice] Daily digest v1.3706 (6 messages)
|
Список | pgsql-novice |
On Mon, Nov 16, 2015 at 6:26 PM, Alan Hodgson <ahodgson@simkin.ca> wrote:
On Monday, November 16, 2015 05:36:08 PM Michael Convey wrote:
> Thank you. Assuming a default Fedora installation, if I am logged in as
> Linux user lab and I don't know the Linux "postgres" password, but I do
> know the PostgreSQL "postgres" role password; what is the syntax (from the
> Linux command line) to login as the "postgres" role and connect to the
> "postgres" database?
psql -U postgres postgres
It'll prompt for the password.
Make sure you've enabled md5 or password as an authentication method allowed
for local in pg_hba.conf.
Thank you. I received the following error:
bash-4.2 ~ $ psql -U postgres postgres
psql: FATAL: Peer authentication failed for user "postgres"
Here's the relevant portion of my pg_hba.conf file:
-----------------------------------------------------------------------------------------------------------
# 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 ident
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
-----------------------------------------------------------------------------------------------------------
Do I modify the first section, as follows?
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
local all all samehost md5 #added
Or, do I replace the first line with #added?
В списке pgsql-novice по дате отправления: