0

Hi i am using postgresql .

my

Postgres User : postgres 
Passwprd : abc123

but when i type root@xxxx:~#psql -U postgres -W

it says

   root@xxxx:~#   Ident authentication failed for user "root"

but when i su postgres cd and then type following command

#psql -U postgres -W

it is working correctly and i can access to all databases .

when i try to access my site it gives me the error in posstgres error log

password authentication failed for user "postgres"

why is this happening , please help me , thanks in advance

UPDATE

my pg_hba.conf

# Database administrative login by Unix domain socket
local   all             postgres                                trust

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               md5
Kanishka Panamaldeniya
  • 17,302
  • 31
  • 123
  • 193

1 Answers1

3

You have to create a role name root

create role root login 
Vivek S.
  • 19,945
  • 7
  • 68
  • 85
  • Hi now the page is reloading again and again , i checked the postgres error .log it says permission denied for relation ezuser , actually it is permission denied for all relations , but when i type SELECT contentobject_id, login, email, password_hash, password_hash_type FROM ezuser in console it is working perfectly / – Kanishka Panamaldeniya Aug 08 '14 at 10:03