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

Re: password authentication always failed

From: Akbar <melinda_sayang(at)hotpop(dot)com>
To: "Mike G(dot)" <mike(at)thegodshalls(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: password authentication always failed
Date: 2005-01-20 17:56:52
Message-ID: 1106243812.10796.16.camel@tux.akbarhome (view raw or flat)
Thread:
Lists: pgsql-novice
This is what I remember...
I installed postgresql. Then as root, I add user postgres.....
Then:
initdb -D /bla/bla/bla
pg_ctl -D /bla/bla/bla start
Then I import database....
Then.... 
psql mydb
In prompt, I add garfield user.... who can create database but not
another user.....

Then.... I did what I have told to mailing list in first post of this
thread, that is:
$ su postgres
$ initdb -D /usr/local/pgsql/proj -U garfield
$ psql -U garfield -f mydb.sql template1
$ psql -U garfield mydb

On Wed, 2005-01-19 at 23:46 -0600, Mike G. wrote:
> When the method is trust it allows one to connect to the db with any user name supplied.  When you change the method to md5 the user name must exist in the database before connecting.
> 
> After you initially installed postgres did you connect to the db and issue a CREATE USER garfield command?
> 
> 
> On Thu, Jan 20, 2005 at 04:10:17PM +0700, Akbar wrote:
> > Hi, 
> > I have superuser named postgres and normal user named garfield.
> > Then I do this in command prompt :
> > $ su postgres
> > $ initdb -D /usr/local/pgsql/proj -U garfield
> > $ psql -U garfield -f mydb.sql template1
> > $ psql -U garfield mydb
> > 
> > Ok, everything is fine.... I can connect to database and do some
> > operation.
> > Note: mydb.sql was created with this command before:
> > $ pg_dump -u -C -f mydb.sql mydb
> > 
> > Then I changed the pg_hba.conf in /usr/local/pgsql/proj from :
> > # 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               trust
> > 
> > to 
> > # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
> > 
> > # "local" is for Unix domain socket connections only
> > local   all         all                               md5
> > # IPv4 local connections:
> > host    all         all         127.0.0.1/32          trust
> > # IPv6 local connections:
> > host    all         all         ::1/128               trust
> > 
> > Then I restarted database. When I do this command:
> > $ psql -U garfield mydb
> > password:
> > It always failed with error:
> > FATAL:  password authentication failed for user "garfield"
> > psql: FATAL:  password authentication failed for user "garfield"
> > 
> > I have done this as postgres to make sure that password is correct:
> > # ALTER USER garfield PASSWORD 'garfield' CREATEDB;
> > 
> > What is wrong? garfield can create database but not another user.
> > Could that be problem?????
> > 
> > Thank you.
> > 
> > Regards,
> > 
> > Akbar
> > 
> > 
> > 
> > 
> > ---------------------------(end of broadcast)---------------------------
> > TIP 7: don't forget to increase your free space map settings
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match



In response to

pgsql-novice by date

Next:From: Van Ingen, LaneDate: 2005-01-20 20:28:22
Subject: What Do I Need to Get Started with PostreSQL for Win32 (version 8.0)
Previous:From: Sean DavisDate: 2005-01-20 17:50:52
Subject: Re: generating dynamic queries using pl/pgsql

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