Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 30, 2015 at 3:09 AM, Arup Rakshit
<aruprakshit@xxxxxxxxxxxxxx> 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 with a 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux