Re: createdb: could not connect to database

From: Devrim GUNDUZ <devrim(at)commandprompt(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: createdb: could not connect to database
Date: 2006-02-04 18:38:06
Message-ID: 1139078286.4139.21.camel@evim.gunduz.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

On Sat, 2006-02-04 at 17:56 +0000, Paul Smith wrote:

> Did you start postgresql service?
> >
> > # service postgresql start
>
> Thanks, Devrim. After "service postgresql start", I get
>
> $ createdb mydb
> createdb: could not connect to database postgres: FATAL: role
> "psmith" does not exist
> $

- By default, RPM installations use ident authentication. This basically
means that you must be postgres user to access to PostgreSQL. First su
to root, and the su to postgres and run createdb then. (you cannot
directly su to postgres since it does not have an initial password)

- You can also edit pg_hba.conf to allow access to regular users:
http://www.postgresql.org/docs/8.1/static/client-
authentication.html#AUTH-PG-HBA-CONF

- You can create psmith role and allow access to that user.

Regards,
--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas Kretschmer 2006-02-04 18:45:36 Re: createdb: could not connect to database
Previous Message Jan Danielsson 2006-02-04 18:32:59 Select date & time