Skip site navigation (1) Skip section navigation (2)

Re: grant database access

From: Carlo Ascani <carlo(dot)ascani(at)2ndquadrant(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: grant database access
Date: 2011-09-05 08:45:28
Message-ID: 20110905104528.519f1e4d@2ndquadrant.it (view raw or flat)
Thread:
Lists: pgsql-novice
On Mon, 5 Sep 2011 09:04:47 +0100
e-letter <inpost(at)gmail(dot)com> wrote:

> Readers,
> 
> I have inherited a m$ pc with postgresql83 installed. Have tried to
> create a new database using pgadminiii but received the error:
> 
> Access to database denied
> The server doesn't grant access to the database: the server reports
> FATAL: no pg_hba.conf entry for host "127.0.0.1", user "postgresr",
> database "postgres", SSL off
> To access a database on a PostgreSQL server, you first have to grant
> primary access to the server for your client (Host Based
> Authentication). PostgreSQL will check the pg_hba.conf file if a
> pattern that matches your client address / username / database is
> present and enabled before any SQL GRANT access control lists are
> evaluated.
> The pghbaconf file contains:
>
> # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>
> # IPv4 local connections:
> local	 all	 all	 	 trust
> # IPv6 local connections:
> #host    all         all         ::1/128               md5
>
> Any advice please?

I assume that "postgresr" as a username is a cut&paste mistake.

As the message said, you have to add a proper hba entry to let the user
"postgres" connect to the server.

You can try and temporarily add a row like this to your pg_hba.conf:

host    postgres         postgres         127.0.0.1/32          trust

Remember to reload the server. I really advice you to read carefully 
the documentaion about pg_hba.conf for your postgres version, you can
find it at:
http://www.postgresql.org/docs/8.3/static/auth-pg-hba-conf.html

Cheers

-- 
 Carlo Ascani - 2ndQuadrant Italia
 PostgreSQL Training, Services and Support
 carlo(dot)ascani(at)2ndQuadrant(dot)it - www.2ndQuadrant.it

In response to

pgsql-novice by date

Next:From: Eric HulburdDate: 2011-09-06 01:05:59
Subject: getting started with psql
Previous:From: e-letterDate: 2011-09-05 08:04:47
Subject: grant database access

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group