Tuesday, October 11, 2016

Install PostgeSQL on Ubuntu 16.04

Based on https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04

Install PosgreSQL:

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
  • Find out where configuration files are stored:

sudo -u postgres psql # use \q to exit

show config_file; # somethis like /etc/postgresql/9.5/main...
\q
  • Cchange in posgresql.config

    • #listen_addresses = 'localhost' # what IP address(es) to listen on;
    • to listen_addresses = '*' # what IP address(es) to listen on;
  • Add in pg_hba.conf

    • host all all 10.0.0.0/8 md5 Change through psql the password for database login postgres:
    • \password postgres
  • Restart postgresql:

    • exit (to logout from postgres user session)
    • systemctl restart postgreql
IyBJbnN0YWxsIFBvc3RnZVNRTCBvbiBVYnVudHUgMTYuMDQNCg0KQmFzZWQgb24gW2h0dHBzOi8vd3d3LmRpZ2l0YWxvY2Vhbi5jb20vY29tbXVuaXR5L3R1dG9yaWFscy9ob3ctdG8taW5zdGFsbC1hbmQtdXNlLXBvc3RncmVzcWwtb24tdWJ1bnR1LTE2LTA0XShodHRwczovL3d3dy5kaWdpdGFsb2NlYW4uY29tL2NvbW11bml0eS90dXRvcmlhbHMvaG93LXRvLWluc3RhbGwtYW5kLXVzZS1wb3N0Z3Jlc3FsLW9uLXVidW50dS0xNi0wNCAiSW5zdGFsbCIpDQoNCkluc3RhbGwgUG9zZ3JlU1FMOg0KYGBgDQpzdWRvIGFwdC1nZXQgdXBkYXRlDQpzdWRvIGFwdC1nZXQgaW5zdGFsbCBwb3N0Z3Jlc3FsIHBvc3RncmVzcWwtY29udHJpYg0KYGBgDQoNCi0gRmluZCBvdXQgd2hlcmUgY29uZmlndXJhdGlvbiBmaWxlcyBhcmUgc3RvcmVkOg0KDQpzdWRvIC11IHBvc3RncmVzIHBzcWwgIyB1c2UgXHEgdG8gZXhpdA0KDQpgYGANCnNob3cgY29uZmlnX2ZpbGU7ICMgc29tZXRoaXMgbGlrZSAvZXRjL3Bvc3RncmVzcWwvOS41L21ha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