Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

wwwxxxx.jpeg, xxxxdup, WWWXXX..APC site:board.issociate.de, WWWXXXAPC, WWWXXX .CMD, Wwwwxxx reemine, WWWXXX.VCBA, WWWXXX.VCBA, TheboL.wwwxxxxx, WWWXXXAPC

Links

XODOX
Impressum

#1: Fwd: resetting superuser password

Posted on 2005-11-09 13:38:24 by mad7

I have lost the superuser (user postgres) password, but I still have the un=
ix root password. Is there anything I can do to reset the postgres user's =
password (short of reinstalling Postgres)?

Obviously, I can su to unix user postgres, but this does not seem to advanc=
e my cause, as doing "psql -U postgres" still prompts me for a password, wh=
ich is not the same as the unix postgres user's password.=20

OS: RedHat 9

Help!

Thanks,
Marc

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Report this message

#2: Re: Fwd: resetting superuser password

Posted on 2005-11-09 13:44:25 by Devrim GUNDUZ

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Wed, 9 Nov 2005, Marc A. Donis wrote:

> I have lost the superuser (user postgres) password, but I still have=20
> the unix root password. Is there anything I can do to reset the=20
> postgres user's password (short of reinstalling Postgres)?

Edit pg_hba.conf and set the auth method to trust. Then reload postgresql=
..=20
This will stop PostgreSQL from asking you a password.

Regards,
- --
Devrim GUNDUZ
Kivi Bili=FEim Teknolojileri - http://www.kivi.com.tr
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDce8u4zE8DGqpiZARArkjAJ4jmuLYV6I3oLnTowbF3d0IOfDYTQCe KDqZ
je2SdfQvAxgOTUhirXlzq6A=3D
=3D8VN2
-----END PGP SIGNATURE-----
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Report this message

#3: Re: Fwd: resetting superuser password

Posted on 2005-11-09 13:47:54 by Martin Fandel

--=-ep2xNn9N3L0+WSiLd9rE
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,

which version of postgres do you have? Put this temporarly into
the /var/lib/pgsql/data/pg_hba.conf:

if postgres 8:
local all postgres 127.0.0.1/32 trust

if postgres 7:
local all trust

then connect to template1...:
psql -U postgres -d template1

....and set your password:
alter user postgres with encrypted password 'blablubb';

i hope this works.

regards,

martin

Am Mittwoch, den 09.11.2005, 13:38 +0100 schrieb Marc A. Donis:

> I have lost the superuser (user postgres) password, but I still have the unix root password. Is there anything I can do to reset the postgres user's password (short of reinstalling Postgres)?
>
> Obviously, I can su to unix user postgres, but this does not seem to advance my cause, as doing "psql -U postgres" still prompts me for a password, which is not the same as the unix postgres user's password.
>
> OS: RedHat 9
>
> Help!
>
> Thanks,
> Marc
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> http://archives.postgresql.org

--=-ep2xNn9N3L0+WSiLd9rE
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.2.2">
</HEAD>
<BODY>
Hi,<BR>
<BR>
which version of postgres do you have? Put this temporarly into the /var/lib/pgsql/data/pg_hba.conf:<BR>
<BR>
if postgres 8:<BR>
<TT>local&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; postgres&nbsp;&nbsp;&nbsp;&nbsp; 127.0.0.1/32 trust</TT><BR>
<BR>
if postgres 7:<BR>
<TT>local&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; trust</TT><BR>
<BR>
then connect to template1...:<BR>
<TT>psql -U postgres -d template1</TT><BR>
<BR>
....and set your password:<BR>
<TT> alter user postgres with encrypted password 'blablubb';</TT><BR>
<BR>
i hope this works.<BR>
<BR>
regards,<BR>
<BR>
martin<BR>
<BR>
Am Mittwoch, den 09.11.2005, 13:38 +0100 schrieb Marc A. Donis:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">I have lost the superuser (user postgres) password, but I still have the unix root password. Is there anything I can do to reset the postgres user's password (short of reinstalling Postgres)?</FONT>

<FONT COLOR="#000000">Obviously, I can su to unix user postgres, but this does not seem to advance my cause, as doing &quot;psql -U postgres&quot; still prompts me for a password, which is not the same as the unix postgres user's password. </FONT>

<FONT COLOR="#000000">OS: RedHat 9</FONT>

<FONT COLOR="#000000">Help!</FONT>

<FONT COLOR="#000000">Thanks,</FONT>
<FONT COLOR="#000000">Marc</FONT>

<FONT COLOR="#000000">---------------------------(end of broadcast)---------------------------</FONT>
<FONT COLOR="#000000">TIP 4: Have you searched our list archives?</FONT>
<FONT COLOR="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://archives.postgresql.org">http://archives.</FONT>postgresql.org</A>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-ep2xNn9N3L0+WSiLd9rE--

Report this message

#4: Re: Fwd: resetting superuser password

Posted on 2005-11-09 18:50:09 by mad7

Thanks to all who replied, and all apologies for the multiple posting
(my fault).

The solution (in postgres 8.0.1):

Edit data/pg_hba.conf to contain the line:

local all postgres trust

Then su to unix user postgres and restart postges with:

> bin/pg_ctl restart -D /usr/local/pgsql/data -m fast

and finally, login to postgres with:

> psql -U postgres -d template1

and do

alter user postgres with encrypted password 'newpass';

Remove the line added to pg_hba.conf, and restart postgres again!
I'm a happy (and very relieved) camper.

Marc


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Report this message