Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 8743A9FA0FB for ; Sat, 2 Dec 2006 19:25:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 43166-08 for ; Sat, 2 Dec 2006 19:25:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 2BAC59F9EED for ; Sat, 2 Dec 2006 19:25:36 -0400 (AST) Received: from 10.10.1.93 ([10.10.1.93]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Sat, 2 Dec 2006 23:25:29 +0000 Received: from localhost.localdomain by mail.g2switchworks.com; 02 Dec 2006 17:25:23 -0600 Subject: Re: Lost password to user postgres From: Scott Marlowe To: Philippe Salama Cc: pgsql-admin@postgresql.org In-Reply-To: <638600.66455.qm@web90513.mail.mud.yahoo.com> References: <638600.66455.qm@web90513.mail.mud.yahoo.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 02 Dec 2006 17:25:23 -0600 Message-Id: <1165101923.25316.8.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/20 X-Sequence-Number: 23812 On Sat, 2006-12-02 at 11:44 -0800, Philippe Salama wrote: > 2 years ago, I installed postgresql on my desktop and used it for a > while for learning purposes. Then, I stopped using it. I forgot the > password to the user postgres You don't have to reinstall. you've got three basic options: 1. Change the password in single user mode 2. Edit pg_hba.conf and set it to trust mode, change your password, change back to md5 3. Re-initdb your cluster. For 1: su - postgres (from root if you have to) pg_ctl stop postgres template1 (or some other database you know exists) alter user postgres password 'newpassword'; For 2: su - postgres cd $PGDATA vi pg_hba.conf // change entries at bottom to trust pg_ctl reload psql template1 alter user postgres password 'newpassword'; For 3: su - postgres pg_ctl stop echo $PGDATA // make sure this is set to something like /var/lib/pgsql rm -rf $PGDATA/* initdb // with whatever options you need. I prefer option 2, as you don't have to take down your database to do it.