Re: How to recover or resent the password for the user 'postgres' - Mailing list pgsql-general

From John McKown
Subject Re: How to recover or resent the password for the user 'postgres'
Date
Msg-id CAAJSdjjYT719=tptcLy+2UTYvFO1LThHz8kK196Q24=Ox5dswg@mail.gmail.com
Whole thread Raw
In response to How to recover or resent the password for the user 'postgres'  (Arup Rakshit <aruprakshit@rocketmail.com>)
List pgsql-general
On Mon, Mar 30, 2015 at 3:09 AM, Arup Rakshit
<aruprakshit@rocketmail.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@myapp(add_postgres_addapter)]$ su - postgres
> Password:
> su: Sorry
> [shreyas@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
witha password in this case ? 

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

 [shreyas@myapp(add_postgres_addapter)]$ sudo su - #change to root
 [root@myapp(add_postgres_addapter)]# su - postgres # change to postgres
 [postgres@myapp(add_postgres_addapter)]$ #do work as user postgres
 [postgres@myapp(add_postgres_addapter)]$exit #return to root
 [root@myapp(add_postgres_addapter)]# exit #return to my normal user
 [shreyas@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@system]$ sudo passwd postgres
Changing password for user postgres.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[user@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


pgsql-general by date:

Previous
From: Deven Phillips
Date:
Subject: Muti-table join and roll-up aggregate data into nested JSON?
Next
From: Vincent Veyron
Date:
Subject: Re: Link Office Word form document with data from PostgreSQL