Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Change Heroku-Postgresql DB password

Simple question but my googling has completely failed me.

How do you change the password for the postgres database for a Heroku Rails application?

like image 697
LennonR Avatar asked Nov 16 '11 17:11

LennonR


3 Answers

heroku pg:credentials DATABASE --reset ought to do it

Source: https://devcenter.heroku.com/articles/heroku-postgresql

like image 70
ripper234 Avatar answered Oct 18 '22 01:10

ripper234


This used to not be possible, but now with the new Heroku Postgres plans you can now 'rotate' your database credentials.

You can do this via heroku pg:credentials HEROKU_POSTGRESQL_GRAY_URL --reset where the HEROKU_POSTGRESQL_GRAY_URL is the correct name based on your heroku config output.

On old plans, where this may be unsupported, you may be able to get heroku support to do it if you logged a ticket although they'll probably want a valid reason.

like image 39
John Beynon Avatar answered Oct 18 '22 01:10

John Beynon


pg:credentials --reset is deprecated. Please use pg:credentials:rotate instead

heroku pg:credentials:rotate DATABASE -a sushi

Source: https://devcenter.heroku.com/articles/heroku-postgresql-credentials

like image 5
Mohsen Avatar answered Oct 18 '22 02:10

Mohsen