Tuesday, 7 February 2012

enabling remote access to the database

This sets up the database so you can access it from other computers (for example using psql)

  • amend the hba file to specify access conditions:
    • file: /etc/postgresql/9.1/main/pga_hba.conf
    • append: host    all     all     192.168.1.0/24  trust
  • amend the main config file to listen externally as well as internally
    • file: /etc/postgresql/9.1/main/postgresql.conf
    • amend the line #listen_addresses = 'localhost'
    • to: listen_addresses = '*'
    • (don't forget to remove the #)
  • restart postgresql
    • sudo /etc/init.d/postgresql restart

No comments:

Post a Comment