Re: jdbc pg_hba.conf error

From: "Bhavana(dot)Rakesh" <Bhavana(dot)Rakesh(at)noaa(dot)gov>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: jdbc pg_hba.conf error
Date: 2007-05-30 17:08:54
Message-ID: 465DAFA6.1030704@noaa.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm using version 7.4. The "hostnossl" is not helping either. My error is

[brakesh(at)lnx383 ~]$ psql -U brakesh -h 127.0.0.1 -d testing123
psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "brakesh",
database "testing123", SSL off

The current pg_hba.conf file is as follows:

# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust

# IPv4-style local connections:
#host all all 127.0.0.1 255.255.255.255 trust
hostnossl all all 127.0.0.1 255.255.255.255 trust
hostnossl testing123 brakesh 127.0.0.1
255.255.255.255 trust
# IPv6-style local connections:
#host all all ::1/128
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust

# Using sockets credentials for improved security. Not available everywhere,
# but works on Linux, *BSD (and probably some others)

#local all all ident sameuser

#Allow any user from any host with IP address 192.168.93.x to
# connect to database "template1" as the same username that ident on that
# host identifies him as (typically his Unix username):
#
#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
hostnossl testing123 all 140.90.193.238 255.255.255.0 ident
sameuser

Oliver Elphick wrote:
> On Wed, 2007-05-30 at 18:35 +0200, Martijn van Oosterhout wrote:
>
>> On Wed, May 30, 2007 at 12:30:38PM -0400, Bhavana.Rakesh wrote:
>>
>>> Oliver,
>>>
>>> When I do a :
>>> psql -p 5000 testing123
>>> I can make a connection. However, when I do a
>>>
>>> psql -U brakesh -h 127.0.0.1 -d testing123
>>>
>>> I get the followign error:
>>>
>>> psql: FATAL: no pg_hba.conf entry for host "127.0.0.1", user "brakesh",
>>> database "testing123", SSL off
>>>
>> Ofcourse, the first connection is a local connection, which you
>> obviously have configured. The latter connects to localhost, which you
>> havn't configured.
>>
>
> His original message (which I snipped) said he had:
>
> # IPv4-style local connections:
> host all all 127.0.0.1 255.255.255.255 trust
> host testing123 brakesh 127.0.0.1 255.255.255.255 trust
>
> So it seems to me he did have it configured.
>
> In fact the first host line should be used and the second one for user
> brakesh is redundant, since it comes later in the file. The only thing
> I can see is that it might be related to SSL.
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message gonzales 2007-05-30 17:13:56 Re: jdbc pg_hba.conf error
Previous Message PFC 2007-05-30 17:04:27 Re: Geographic data sources, queries and questions