Jamie's Weblog

Procrastination and utter drivel since 2001!
  • Email
  • Github
  • Linkedin
  • Twitter
  • Rss
  • Home
  • About
  • Archives
  • Publications
Home» Ruby on Rails » Connecting Navicat to Postgresql on Vagrant

Connecting Navicat to Postgresql on Vagrant

Posted on September 13, 2012 by Jamie Lawrence in Ruby on Rails, Tips & Tricks

I’m falling in love with Postgres as a database but it comes fairly well locked down (good for production, not so good for development). I do all my development in a Vagrant box so a) the environment matches production and b) I don’t pollute my Mac with various conflicting versions of things. Mostly I’ve been using the psql command which is actually pretty good if you can remember all the commands. But sometimes you really want a decent UI for the database, and that’s where Navicat comes in (actually, I use the cheaper Navicat Essentials).

First, you’ll need to to add this line to your Vagrantfile to forward your local

  config.vm.forward_port 5432, 5432                 # postgres

This forwards the local port of 5432 to the Vagrant instance port 5432.

But you’ll still get connection errors because Postgres isn’t configured to allow connections from a non-local address. Add the highlighted line to /etc/postgresql/9.1/main/pg_hba.conf

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             10.0.2.2/32             md5

You might also need to add this line to /etc/postgresql/9.1/main/postgresql.conf

listen_addresses = '*'

You can then connect to Postgresql with Navicat using the following options

Navicat connection options

navicat, postgresql, vagrant 2 Comments

2 comments on “Connecting Navicat to Postgresql on Vagrant”

  1. andru says:
    May 13, 2013 at 1:17 pm

    Take a look on free tool Valentina Studio, is the best way to transform your data into meaningful information; create, administer, query and explore Valentina DB, MySQL, Postgre and SQLite databases for free on 32/64 bit Windows, Linux and Mac OS X. http://www.valentina-db.com/en/valentina-studio-overview

  2. Stefan Wrobel says:
    May 21, 2013 at 5:04 pm

    Thank you! Exactly what I needed.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Contact Me

  • jamie@ideasasylum.com
  • ideasasylum
    • Twitter

Categories

  • BalanceTrackr (2)
  • C# (1)
  • dualpricing.ie (2)
  • hack (1)
  • Java (4)
  • Linux (3)
  • Measure it to change it (2)
  • Parenting (2)
  • Personal (36)
  • Photography (13)
  • Projects (7)
  • Python (3)
  • rant (20)
  • Reviews (20)
  • Ruby on Rails (18)
  • Taskmonifier (1)
  • Tech (1)
  • Tips & Tricks (7)
  • tuesdaypush (1)
  • Uncategorized (877)
  • Useful (3)
  • Weekly Picks (5)
  • Work (2)

Tags

accident backups barcampcork batteries bizcamp business car copyright depression dual pricing eneloop fowadublin fun gallstones git svn health ipad iphone lens life motivation nginx Personal phd photographers photography photos pinterest podcasts prism quote rails rant renault scenic review rspec ruby sew shutterscouts ssl startups swimming vagrant windows wrap

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

(c) 2012 Jamie's Weblog