6

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.

1
  • Heroku offers database-as-a-service ... not a full server you have local access to. You can do very limited things with heroku bash but that's about it. If your motivation is security then use SSL; otherwise you might need to run Pg on a real VPS. Commented May 28, 2013 at 0:44

3 Answers 3

4

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...

Sign up to request clarification or add additional context in comments.

Comments

3

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

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.