Home heroku run rails db asking for password that i never set
Reply: 1

heroku run rails db asking for password that i never set

Siddharth Sharma
Siddharth Sharma Published in 2018-02-02 13:26:46Z

After deploying rails project on Heroku,I tried to get into the database console but when i run:

$ heroku run rails db

it is asking for password:


I forget the password,now i want to create table in database, any solution to setup password again??

Stan Mazhara
Stan Mazhara Reply to 2018-02-03 00:36:32Z

heroku pg:psql is the canonical (and faster!) way to connect to heroku db.

The reason heroku run rails db doesn't work is because what it does is it creates a one-off process on Heroku with your codebase and runs rails db command there. rails db depends on $RAILS_ENV environment variable to fetch db credentials from config/database.yml which doesn't work on Heroku.

If you must know your Heroku db password you can get it from heroku config:get DATABASE_URL

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.313416 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO