Skip to content

Instantly share code, notes, and snippets.

@galaydaroman
Created May 16, 2016 21:39
Show Gist options
  • Save galaydaroman/5585bbec243f25253832630d4b19bddd to your computer and use it in GitHub Desktop.
Save galaydaroman/5585bbec243f25253832630d4b19bddd to your computer and use it in GitHub Desktop.
Postgres port forwarding on AWS via SSH

HOW TO CONNECT TO REMOTE DATABASE VIA LOCAL RAILS C

ssh -vNgL 5433:postgres.intenal-remote.host:5432 <host>

on database.yml

development:
  database: <name>
  adapter: postgresql
  encoding: unicode
  pool: 5
  username: postgres
  password: postgres
  host: localhost
  port: 5433
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment