Thread: Can't Get Going in psql

Can't Get Going in psql

From
"Van Ingen, Lane"
Date:
I have just finished installing v8.0.0 on Windows 2003, and the install appeared to go smoothly. I
have PostgreSQL running as a service, will be used as a single user environment at present.
 
I am folliwng the 'Getting Started' section of the docs (Chapter1). Didn't use much of Chapter 14
(referenced by Chapter 1) aside from setting PATH variables. I am now in section 1.3 ('Creating
A Database'). The first instruction is to test the installation by trying to use 'createdb'; it is failing
on the following message:
    createdb: Could not connect to database template1: FATAL: password authentication failed for
    user "Administrator".
 
Three things confusing about this:
  - not sure what I am to do with a template database (which it evidently defaulted to); I am trying to
     create a new database
  - on createdb command, I am unable to specify a user and password. It appears to want an
    "Administrator" password (server administrator or database administrator?). When I give the 
     database administrator password, it gives me the error above. The only other users known to 
     Postgres at all would be those defined in the install procedure ('root', for the service, AND 
     'postgres', as the DB administrator); those passwords don't work.
  - Tried to invoke psql and create by database that way using users I know about from last paragraph,
     but can't even get logged in.
 
I am stuck and don't know what to try next.

Re: Can't Get Going in psql

From
John DeSoi
Date:
On Jan 27, 2005, at 7:48 PM, Van Ingen, Lane wrote:

> Three things confusing about this:
>   - not sure what I am to do with a template database (which it
> evidently defaulted to); I am trying to
>      create a new database
>   - on createdb command, I am unable to specify a user and password.
> It appears to want an
>     "Administrator" password (server administrator or database
> administrator?). When I give the
>      database administrator password, it gives me the error above. The
> only other users known to
>      Postgres at all would be those defined in the install procedure
> ('root', for the service, AND
>      'postgres', as the DB administrator); those passwords don't work.
>   - Tried to invoke psql and create by database that way using users I
> know about from last paragraph,
>      but can't even get logged in.
>

The user/password you need to use is postgres -- for the new
installation, it is the only user in the database. You got the error
about 'Administrator' probably because you did not specify a user name
at all and it uses the Windows user name of your current login.

So you are doing something like this?

createdb.exe -U postgres -W mydb

If you are certain you have the right password, my only other
suggestion is to temporarily turn off password authentication, login,
and then reset the password. See this section on the pg_hba.conf file:

http://www.postgresql.org/docs/8.0/interactive/client-
authentication.html



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL