Remote connection to heroku (Postgre sql) database
How to easily connect to PostgreSQL, hosted on Heroku, with pgAdmin.
All you need are own login data to database. There are two ways to obtain this:
1. From the web interface Heroku.
After logging in you can see a list of data, including password.
2. From heroku command line:
After logging in you can get credentials from heroku heroku pg
Login to heroku:
Objective-C
1 2 3 4 5 |
bash:>heroku login Enter your Heroku credentials. Email: username@heroku.com Password (typing will be hidden): Authentication successful. |
Get list of databases
Objective-C
1 2 3 4 5 6 7 8 9 10 11 |
bash:>heroku pg:info --app herokuapptest === HEROKU_POSTGRESQL_SILVER_URL (DATABASE_URL) Plan: Dev Status: available Connections: 2 PG Version: 9.1.6 Created: 2012-10-13 19:27 UTC Data Size: 811.9 MB Tables: 781 Rows: 5200002/10000000 (In compliance) Fork/Follow: Unsupported |
Get credentials from heroku database
Objective-C
1 2 3 4 5 6 7 |
bash:>heroku pg:credentials HEROKU_POSTGRESQL_SILVER_URL --app herokuapptest Connection info string: "dbname=d8p1mdl6bob38p host=ec2-58-233-280-5.compute-1.amazonaws.com port=5432 user=sskeuiakkxi password=s54s74wwws5-a5ss45s8 sslmode=require" |
heroku pg:credentials return full connection string.
Posted on 30 January 2013