Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get shared database url in heroku

How to get SHARED_DATABASE_URL in heroku.. while am trying to migrate it is asking for SHARED_DATABASE_URL how can i get it.. ??

heroku pg:reset --db SHARED_DATABASE_URL

What should i add in the place of SHARED_DATABASE_URL?? am working in ruby on rails

could anyone help me on this.

like image 236
Abhiram Avatar asked Nov 12 '12 16:11

Abhiram


People also ask

What is database URL in Heroku PostgreSQL?

The DATABASE_URL config var designates the URL of an app's primary Heroku Postgres database. For apps with a single database, its URL is automatically assigned to this config var. For apps with multiple Postgres databases, set the primary database with heroku pg:promote .

How do I get my Heroku database credentials?

Creating a new credentialTo create the credential through data.heroku.com, select the Credentials tab and click the Create Credential button. The name should reflect the purpose of the credential. In the above example, limited_user is used as the credential's username when connecting to the database.

How do I browse Heroku database?

You can find them by visiting the Resources tab on your Dashboard then clicking on the DB you use. It will take you to the Addons page in another tab. Click on the Settings tab then View Credentials. Using these credentials, you can use Adminer to login to the DB.


1 Answers

You can use command: heroku pg:info or just heroku pg to get information about your database. You will get something like this:

HEROKU_POSTGRESQL_GRAY_URL (DATABASE_URL)

Then run: heroku pg:reset HEROKU_POSTGRESQL_GRAY_URL

to reset database on heroku.

like image 78
Thanh Avatar answered Sep 30 '22 09:09

Thanh