Обсуждение: Create database/password problem

Поиск
Список
Период
Сортировка

Create database/password problem

От
Phillip Criley
Дата:
Currently, I'm running FC5, KDE3.5, Postgresql v8.1.4 and trying to use 
pgadmin.  I'm a refugee from windoze, Paradox, Delphi, 
Interbase/Firebird (about 16 years) and Oracle but my cat about wore her 
eyeballs out watching me try to get Postgresql/pgadmin to create the 
first database. It will not take the password. It appears to me that 
pgadmin is supposed to create the password file when one clicks the 
create (database) button. Since I can't find the .pgpass, postgresql 
probably isn't going to find it either. Could you explain to me how that 
file gets created on a _new_ installation? I think that's the problem. 
At any rate I have to get this running and I sure would rather use 
pgadmin than the command line.

Thanks,
Phil


Re: Create database/password problem

От
"Dave Page"
Дата:

> -----Original Message-----
> From: pgadmin-support-owner@postgresql.org
> [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of
> Phillip Criley
> Sent: 25 August 2006 16:19
> To: pgadmin-support@postgresql.org
> Subject: [pgadmin-support] Create database/password problem
>
> Currently, I'm running FC5, KDE3.5, Postgresql v8.1.4 and
> trying to use
> pgadmin.  I'm a refugee from windoze, Paradox, Delphi,
> Interbase/Firebird (about 16 years) and Oracle but my cat
> about wore her
> eyeballs out watching me try to get Postgresql/pgadmin to create the
> first database. It will not take the password. It appears to me that
> pgadmin is supposed to create the password file when one clicks the
> create (database) button. Since I can't find the .pgpass, postgresql
> probably isn't going to find it either. Could you explain to
> me how that
> file gets created on a _new_ installation? I think that's the
> problem.
> At any rate I have to get this running and I sure would rather use
> pgadmin than the command line.

pgAdmin only creates a pgpass file if you check the Save Password option
when connecting to the *server* (it's got nothing to do with databases).
Without it, you'll just get prompted for the password whenever you
connect. The server/ itself doesn't ever look at the pgpass file - only
the clients do.

What is the exact error message you get, and what precise steps to you
take to see it?

Regards, Dave (just about to leave work for the weekend, but might be
online later...).


Re: Create database/password problem

От
Dave Page
Дата:


On 25/8/06 19:44, "Phillip Criley" <pfcriley@pcwright.com> wrote:

> 
> I was in root and used the add/remove programs to install.  I just tried
> postgres as the user but then I get:
> 
> An error has occured:
> 
> Error connecting to the server: FATAL:  password authentication failed
> for user "postgres"
> 
> I tried different passwords with the same result. Obviously, I missed a
> few things as clicking
> help causes the pgadmin to close.

OK, it's probably easiest to just reset the password and start again.

1) Please edit pg_hba.conf, and set the line for 127.0.0.1/32 to trust
authentication.

2) Restart the PostgreSQL service form the Services snapin to ensure the
change takes effect.

3) Open C:\Program Files\PostgreSQL\8.1\data\global\pg_auth in a text
editor. The superuser username should be the first item on what I would
expect to be the only line. The path above assumes a default installation of
course - adjust to suit if required. DO NOT change the file at all.

4) Open the PostgreSQL Command prompt from the start menu, and type the
following command:

psql -h 127.0.0.1 -U <username from step 3> postgres

The should connect you to the postgres database as your superuser, without a
password.

5) Issue the following SQL:

ALTER USER "<username from step 3>" WITH PASSWORD 'newpassword';

To change the password. Then exit psql (\q).

6) Change the pg_hba.conf line back to md5 auth, and restart the server.

7) Login with pgAdmin using the userid from step 3, and the new password.

Regards, Dave.