Обсуждение: newbie and no idea

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

newbie and no idea

От
Aaron
Дата:
A friend of mine just wrote a database for me using postgres.
I have postgres installed but can't figure out how to change the passwd
for user postgres.

[root@bzq-218-14-208 aamehl]# ps -U postgres
  PID TTY          TIME CMD
 4014 pts/1    00:00:00 postmaster
 4016 pts/1    00:00:00 postmaster
 4017 pts/1    00:00:00 postmaster
[root@bzq-218-14-208 aamehl]#
---------------------------------------
root@bzq-218-14-208 aamehl]# ps -l -C postmaster
F S   UID   PID  PPID  C PRI  NI ADDR    SZ WCHAN  TTY          TIME CMD
0 S    26  4014     1  0  72   0    -  2446 do_sel pts/1    00:00:00
postmaster
1 S    26  4016  4014  0  72   0    -  2693 do_sel pts/1    00:00:00
postmaster
1 S    26  4017  4016  0  72   0    -  2451 do_sel pts/1    00:00:00
postmaster
[root@bzq-218-14-208 aamehl]#

----------------------------------------------------------------
[root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
psql: FATAL:  IDENT authentication failed for user "postgres"

createdb: database creation failed
[root@bzq-218-14-208 aamehl]#

-----------------------------------------------------
Any idea??
I am also interested in getting some front end up and running.
Thanks
Aaron


Re: newbie and no idea

От
Bruno Wolff III
Дата:
On Mon, Aug 18, 2003 at 20:11:41 +0300,
  Aaron <aamehl@bezeqint.net> wrote:
> A friend of mine just wrote a database for me using postgres.
> I have postgres installed but can't figure out how to change the passwd
> for user postgres.
>
> [root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
> psql: FATAL:  IDENT authentication failed for user "postgres"
>

It looks like you aren't using password authentication.
One quick solution is to su to postgres before trying to connect to the
database.
Another is to change your pg_hba.conf and pg_ident.conf files to
allow specific system accounts to connect as the postgres database account.
A third option is to change pg_hba.conf to use one of the password
authentication methods instead of ident.

Re: newbie and no idea

От
Aaron
Дата:
On Mon, 2003-08-18 at 21:25, Pavel Stehule wrote:
> You can try
>
> If you know root's password,

I just installed postgres from rpm and I didn't add passwords. I
certainly don't know the postgres root password...

maybe I should reinstall postgres??
Aaron

> you don't need set postgresql's password. But
> if you don't known root password, you can't change password for postgres
> user (for change of password you can use passwd command).
>
>
> su root
> su postgres
> createuser aamehl
> logout
> logout
> createdb  nigun_test
>
> bye
> Pavel Stehule
>
>
> On 18 Aug 2003, Aaron wrote:
>
> > A friend of mine just wrote a database for me using postgres.
> > I have postgres installed but can't figure out how to change the passwd
> > for user postgres.
> >
> > [root@bzq-218-14-208 aamehl]# ps -U postgres
> >   PID TTY          TIME CMD
> >  4014 pts/1    00:00:00 postmaster
> >  4016 pts/1    00:00:00 postmaster
> >  4017 pts/1    00:00:00 postmaster
> > [root@bzq-218-14-208 aamehl]#
> > ---------------------------------------
> > root@bzq-218-14-208 aamehl]# ps -l -C postmaster
> > F S   UID   PID  PPID  C PRI  NI ADDR    SZ WCHAN  TTY          TIME CMD
> > 0 S    26  4014     1  0  72   0    -  2446 do_sel pts/1    00:00:00
> > postmaster
> > 1 S    26  4016  4014  0  72   0    -  2693 do_sel pts/1    00:00:00
> > postmaster
> > 1 S    26  4017  4016  0  72   0    -  2451 do_sel pts/1    00:00:00
> > postmaster
> > [root@bzq-218-14-208 aamehl]#
> >
> > ----------------------------------------------------------------
> > [root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
> > psql: FATAL:  IDENT authentication failed for user "postgres"
> >
> > createdb: database creation failed
> > [root@bzq-218-14-208 aamehl]#
> >
> > -----------------------------------------------------
> > Any idea??
> > I am also interested in getting some front end up and running.
> > Thanks
> > Aaron
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> >                http://www.postgresql.org/docs/faqs/FAQ.html
> >
>


Re: newbie and no idea

От
"Andrew L. Gould"
Дата:
On Monday 18 August 2003 12:11 pm, Aaron wrote:
> A friend of mine just wrote a database for me using postgres.
> I have postgres installed but can't figure out how to change the passwd
> for user postgres.
>
> [root@bzq-218-14-208 aamehl]# ps -U postgres
>   PID TTY          TIME CMD
>  4014 pts/1    00:00:00 postmaster
>  4016 pts/1    00:00:00 postmaster
>  4017 pts/1    00:00:00 postmaster
> [root@bzq-218-14-208 aamehl]#
> ---------------------------------------
> root@bzq-218-14-208 aamehl]# ps -l -C postmaster
> F S   UID   PID  PPID  C PRI  NI ADDR    SZ WCHAN  TTY          TIME CMD
> 0 S    26  4014     1  0  72   0    -  2446 do_sel pts/1    00:00:00
> postmaster
> 1 S    26  4016  4014  0  72   0    -  2693 do_sel pts/1    00:00:00
> postmaster
> 1 S    26  4017  4016  0  72   0    -  2451 do_sel pts/1    00:00:00
> postmaster
> [root@bzq-218-14-208 aamehl]#
>
> ----------------------------------------------------------------
> [root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
> psql: FATAL:  IDENT authentication failed for user "postgres"
>
> createdb: database creation failed
> [root@bzq-218-14-208 aamehl]#

As root, execute:   passwd postgres

Best of luck,

Andrew Gould


Re: newbie and no idea

От
"Andrew L. Gould"
Дата:
On Monday 18 August 2003 01:41 pm, Aaron wrote:
> On Mon, 2003-08-18 at 21:25, Pavel Stehule wrote:
> > You can try
> >
> > If you know root's password,
>
> I just installed postgres from rpm and I didn't add passwords. I
> certainly don't know the postgres root password...
>
> maybe I should reinstall postgres??
> Aaron

By the looks of your command line prompts, "[root@bzq-218-14-208 aamehl]#",
you are already logged in as root.  Root doesn't need to know another user's
password to change it -- just change it:

[root@bzq-218-14-208 aamehl]# passwd postgres

You will then be prompted for the new password.

Also, root doesn't need a password to become another user:

[root@bzq-218-14-208 aamehl]# su postgres

Although this sounds great, this kind of power justifies the creation of a
regular (not a superuser) user account for routine use, especially if you are
a newbie.

Best of luck,

Andrew Gould

Re: newbie and no idea

От
Devrim GUNDUZ
Дата:
Hi,

On 18 Aug 2003, Aaron wrote:

> [root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
> psql: FATAL:  IDENT authentication failed for user "postgres"

Quick and easy solution for you:

edit ~postgres/data/pg_hba.conf and replace all "ident" string to "trust".

Then, restart PostgreSQL server. The server will not prompt you any
password.

If you want to learn more about authentication methods, then download the
administrator manual from http://www.PostgreSQL.org/docs/#pdfs and follow
the "Authentication Methods" section.

Regards,
--
Devrim GUNDUZ
devrim@gunduz.org                devrim.gunduz@linux.org.tr
            http://www.tdmsoft.com
            http://www.gunduz.org




Re: newbie and no idea

От
Pavel Stehule
Дата:
You can try

If you know root's password, you don't need set postgresql's password. But
if you don't known root password, you can't change password for postgres
user (for change of password you can use passwd command).


su root
su postgres
createuser aamehl
logout
logout
createdb  nigun_test

bye
Pavel Stehule


On 18 Aug 2003, Aaron wrote:

> A friend of mine just wrote a database for me using postgres.
> I have postgres installed but can't figure out how to change the passwd
> for user postgres.
>
> [root@bzq-218-14-208 aamehl]# ps -U postgres
>   PID TTY          TIME CMD
>  4014 pts/1    00:00:00 postmaster
>  4016 pts/1    00:00:00 postmaster
>  4017 pts/1    00:00:00 postmaster
> [root@bzq-218-14-208 aamehl]#
> ---------------------------------------
> root@bzq-218-14-208 aamehl]# ps -l -C postmaster
> F S   UID   PID  PPID  C PRI  NI ADDR    SZ WCHAN  TTY          TIME CMD
> 0 S    26  4014     1  0  72   0    -  2446 do_sel pts/1    00:00:00
> postmaster
> 1 S    26  4016  4014  0  72   0    -  2693 do_sel pts/1    00:00:00
> postmaster
> 1 S    26  4017  4016  0  72   0    -  2451 do_sel pts/1    00:00:00
> postmaster
> [root@bzq-218-14-208 aamehl]#
>
> ----------------------------------------------------------------
> [root@bzq-218-14-208 aamehl]# createdb -U postgres nigun_test
> psql: FATAL:  IDENT authentication failed for user "postgres"
>
> createdb: database creation failed
> [root@bzq-218-14-208 aamehl]#
>
> -----------------------------------------------------
> Any idea??
> I am also interested in getting some front end up and running.
> Thanks
> Aaron
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>


Re: newbie and no idea

От
Aaron
Дата:
Thanks
That works
Aaron
On Tue, 2003-08-19 at 00:07, Andrew L. Gould wrote:
> On Monday 18 August 2003 01:41 pm, Aaron wrote:
> > On Mon, 2003-08-18 at 21:25, Pavel Stehule wrote:
> > > You can try
> > >
> > > If you know root's password,
> >
> > I just installed postgres from rpm and I didn't add passwords. I
> > certainly don't know the postgres root password...
> >
> > maybe I should reinstall postgres??
> > Aaron
>
> By the looks of your command line prompts, "[root@bzq-218-14-208 aamehl]#",
> you are already logged in as root.  Root doesn't need to know another user's
> password to change it -- just change it:
>
> [root@bzq-218-14-208 aamehl]# passwd postgres
>
> You will then be prompted for the new password.
>
> Also, root doesn't need a password to become another user:
>
> [root@bzq-218-14-208 aamehl]# su postgres
>
> Although this sounds great, this kind of power justifies the creation of a
> regular (not a superuser) user account for routine use, especially if you are
> a newbie.
>
> Best of luck,
>
> Andrew Gould