Re: How to recover or resent the password for the user 'postgres'

From: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
To: Arup Rakshit <aruprakshit(at)rocketmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to recover or resent the password for the user 'postgres'
Date: 2015-03-30 11:47:01
Message-ID: CAAJSdjjYT719=tptcLy+2UTYvFO1LThHz8kK196Q24=Ox5dswg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 30, 2015 at 3:09 AM, Arup Rakshit
<aruprakshit(at)rocketmail(dot)com> wrote:
> Hi,
>
> I am trying to follow what has been mentioned below **Setting Up Postgres** (https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres).
>
> But no luck!
>
> [shreyas(at)myapp(add_postgres_addapter)]$ su - postgres
> Password:
> su: Sorry
> [shreyas(at)myapp (add_postgres_addapter)]$
>
> It is asking me the password, whereas I don't know the password of the user `postgres`. How would I create a new role with a password in this case ?

I'm not a Mac person. But, on Linux, what I do is:

[shreyas(at)myapp(add_postgres_addapter)]$ sudo su - #change to root
[root(at)myapp(add_postgres_addapter)]# su - postgres # change to postgres
[postgres(at)myapp(add_postgres_addapter)]$ #do work as user postgres
[postgres(at)myapp(add_postgres_addapter)]$exit #return to root
[root(at)myapp(add_postgres_addapter)]# exit #return to my normal user
[shreyas(at)myapp(add_postgres_addapter)]$

Note that the above is just my editing of what I _think_ you _might_
see. The commands are correct. This assumes you have authority to do
the "sudo su -" to change to root. This is how I change to root
because it does not require that I use the root password. Once in
root, you can "su postgres" to change to the postgres user, without a
password.

Another possibility, again using sudo would be to change the password
on the postgres user like:

[user(at)system]$ sudo passwd postgres
Changing password for user postgres.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[user(at)system]$

>
> I am using OS X version 10.8.2
> Regards,
> Arup Rakshit

--
If you sent twitter messages while exploring, are you on a textpedition?

He's about as useful as a wax frying pan.

10 to the 12th power microphones = 1 Megaphone

Maranatha! <><
John McKown

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Veyron 2015-03-30 13:01:21 Re: [GENERAL] Link Office Word form document with data from PostgreSQL
Previous Message Deven Phillips 2015-03-30 11:27:01 Muti-table join and roll-up aggregate data into nested JSON?