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
    Replies
    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai Project Centers in Chennai

      Delete
  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. Great and useful article. Creating content regularly is very tough. Your points are motivated me to move on.


    SEO Company in Chennai

    ReplyDelete

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

  6. Its a wonderful post and very helpful, thanks for all this information. You are including better information regarding this topic in an effective way.Thank you so much

    Installment Loans Near Me
    Title loans Near Me
    Cash Advances Near Me

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

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

    ReplyDelete
  9. It is really a great and useful piece of info. I’m glad that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
    Seo Company in Chennai
    Digital Marketing Company in Chennai

    ReplyDelete
  10. Anonymous4:13 AM


    Nice blog..! I really loved reading through this article. Thanks for sharing such a
    amazing post with us and keep blogging... iot training in chennai | iot training in chennai quora | iot training and placement in chennai | iot training center in chennai | best iot training centre in chennai

    ReplyDelete
  11. Thank you for sharing
    https://aab-edu.net/

    ReplyDelete
  12. Thanks for sharing this information. Today, Emblix as one of the best and top most service-oriented Digital Marketing Agency in Hyderabad and India , Which provides high-quality result-oriented Digital Services ranging from SEO to Web Design, Social Media Marketing and more, to a broad spectrum of clients from diverse industry segments. Through a well-oiled combination of Quality Solutions, Transparent Pricing, helping brands connect with customers, Flexible Delivery & Contract Model with a firm commitment to deliver on time and to budget, Emblix has successfully built a strong relationship with clients based on mutual trust and respect. Emblix solutions-digital marketing company

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

    ReplyDelete