Re: unable to connect to postgres db via psycopy

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Dan Sawyer <dansawyer(at)earthlink(dot)net>, Christophe Pettus <xof(at)thebuild(dot)com>
Cc: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: unable to connect to postgres db via psycopy
Date: 2016-03-13 03:26:55
Message-ID: 56E4DDFF.8030500@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On 03/12/2016 07:12 PM, Dan Sawyer wrote:
> Thank you for the reply. In the past I have not used this file. Has
> there been a recent change?
>
> Should the new line be:
>
> local all all md5

Yes if you where not using the host= section in your connect string.
local is for local Unix type socket connections. Exception being on
Windows where there are no Unix sockets and local is mapped to
localhost. Since you are using host= in the connection string then the
line(s) you need to change are those starting with host. I would suggest
taking a look at the Postgres docs here:

http://www.postgresql.org/docs/9.5/interactive/auth-pg-hba-conf.html

FYI, the content of pg_hba.conf is determined by how you installed
Postgres and therefore should always be verified.

>
>
> Below is the configuration section of pg_hba.conf:
>
> # 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
>
>
> On 03/12/2016 05:26 PM, Christophe Pettus wrote:
>> On Mar 12, 2016, at 5:23 PM, Dan Sawyer <dansawyer(at)earthlink(dot)net> wrote:
>>
>>> psycopg2.OperationalError: FATAL: Ident authentication failed for
>>> user "dan"
>> The place to look is in your pg_hba.conf, and makes sure that user
>> "dan" has MD5 password access turned on to the appropriate database(s)
>> for localhost.
>>
>> --
>> -- Christophe Pettus
>> xof(at)thebuild(dot)com
>>
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse psycopg by date

  From Date Subject
Next Message Shaan Repswal 2016-03-14 14:11:44 Re: Encountered an error
Previous Message Dan Sawyer 2016-03-13 03:12:05 Re: unable to connect to postgres db via psycopy