Pages

Tuesday, September 02, 2014

Exposing PostgreSQL on vagrant to host OS

I've been working with vagrant lately on a Ruby project and I wanted to the ability to view the PostgreSQL database on the vagrant image through DbVisualizer on my OS X system. This is quite easy to set up in PostgreSQL and vagrant.
  1. Add a port forwarding entry to your Vagrantfile: config.vm.network "forwarded_port", guest: 5432, host: 15432. I'm using Vagrant 1.6.3 here. Start/restart your Vagrant image.
  2. Edit the pg_hba.conf file on the vagrant image. This file may reside in different areas; ours was in /etc/postgresql/9.1/main/. Change the IPv4 local connections entry from...

    host    all             all             127.0.0.1/32            trust
    

    to

    host    all             all             0.0.0.0/0               trust
    

  3. Restart PostgreSQL on the vagrant image: sudo service postgresql restart
  4. Configure your database tool to connect to localhost, port 15432.
You should be able to connect to your Vagrant PostgreSQL databases now.

18 comments:

  1. thanks for this informative post.. learned a lot

    mobile application development in indore

    ReplyDelete
  2. can you tell me some good tutorials ...

    web designing company in indore

    ReplyDelete
  3. What you can do. That's what I do not and have not ever thought of. friv 5

    ReplyDelete
  4. Anonymous11:05 AM


    This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.

    Payday loans in Alabama
    Title loans in South Carolina

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Very nice blog and information. Hope you will update it asap. Tech Arbiters (https://techarbiters.com/)

    ReplyDelete
  8. Enjoyed reading the article above , really explains everything in detail.
    Best Astrologer in Bangalore

    ReplyDelete

  9. Good Blog, Such a Nice Content, Informative for Readers Keep Posting.
    Best digital marketing company in Bangalore
    Best Astrologer in Bangalore

    ReplyDelete
  10. Thanks to share. All our, aspires to be successful. However, they are not always in the same way. If You are in side of astrology? Believe, It occurs as a result of planets that are feeble. Took a sort to get best birth chart horoscope predictions with Pandit sai Jagannatha Famous Astrologer in Bangalore

    ReplyDelete
  11. Excellent post Keep up the good work
    Please look here at
    Vashikaran Astrologer in BTM Layout

    ReplyDelete
  12. Thanks for providing this information. It's very helpful.
    Visit Best Astrologer in Nizamabad

    ReplyDelete
  13. Good astrologycal post,thank you for sharing with community.
    For sofa repair work contact thesofastore gives
    Sofa Refurbishing in Bellandur,Bangalore

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Get the best update of the Scope of Hadoop Technology and job opportunities for it from the best software training institute in Chennai, Infycle Technologies. Call +91-7504633633, +91-7502633633 to get the amazing offers and free demo for having Big Data hadoop training in Chennai.

    ReplyDelete
  16. This is extremely enlightening blog.
    Visit Best Indian Astrologer in Delta.

    ReplyDelete