I'd like to be able to connect to my Heroku postgres (crane) database from my desktop using Putty.
I recently moved from Webfaction to Heroku. On webfaction this was a really simple process (via their docs: http://docs.webfaction.com/user-guide/databases.html#starting-an-ssh-tunnel-with-putty).
Heroku lets you get your database info and credentials using heroku pg:credentials
. Shown here: https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress. I can't seem to figure out how to connect to the database through Putty using this info.
If I try to set things up with the Heroku info Putty gives this error: Disconnected: No supported authentication methods available.
Heroku listens for SSL connections to the database, but doesn't provide a shell account, as would be required to use Putty. They say in their doc:
When you find yourself wanting SSH access, instead try using tools that properly accounts for Heroku’s distributed environment, such as the heroku command line tool and one-off dynos.
And indeed, this contrasts with Webfaction which clearly states that they offer shell access:
Full shell access to fast servers with all your favorite tools pre-installed and maintained for you.
Different companies, different services...
Use the following command literally : heroku pg:psql DATABASE
This will match the config string DATABASE_URL
and connect you to your database with psql.
Note : you may have to add psql
to your PATH
On Mac OS, with the PostGres App :
export PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH
Heroku permit direct connection to the databases, you don't have to use putty or another ssh client to tunnel to the database server.
Use your Heroku postgres credentials to connect directly with psql from your command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With