Re: createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error - Mailing list pgsql-novice

From Tom Lane
Subject Re: createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error
Date
Msg-id 19127.1238260550@sss.pgh.pa.us
Whole thread Raw
In response to createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error  (bijoy <bijoy.franco@gmail.com>)
Responses Re: createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error
List pgsql-novice
bijoy <bijoy.franco@gmail.com> writes:
> when i tried creating database using 'createdb', following error occuered.
> createdb mydb
> createdb: could not connect to database postgres: FATAL:  Ident
> authentication failed for user "root"

You didn't say whose packaging of Postgres this is, but it looks like
you're using a setup that has ident authentication selected.  That
means the only user that can get in initially is user "postgres".
(Well, actually, whatever the initial superuser is, but the odds are
just about 100% that it's named "postgres".)  Your first step should
probably be to create a postgres account for your regular userid
(not root), say via

    su - postgres
    createuser joe

If you don't want authentication to work this way, you can change the
setup in pg_hba.conf.  See the manual under "Client Authentication".
If you're the only person using the machine and you're unworried about
someone cracking into it, you could just as well use "trust" mode
and not bother with restrictions.

            regards, tom lane

pgsql-novice by date:

Previous
From: Aarni
Date:
Subject: Re: createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error
Next
From: bijoy
Date:
Subject: Re: createdb: could not connect to database postgres: FATAL: Ident authentication failed for user "root" error