Monday, July 14, 2014

Configure remote pgadmin to manage Azure Ubuntu postgres database

Steps to configure remote pgadmin (on windows) to manage Azure Ubuntu postgres database


Step 1) Add a password to postgres account

$ sudo passwd postgres
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully


Step 2) Update postgresql.conf and pg_hba.conf to allow external connection

$ su postgres
Password:

$ cd /etc/postgresql/9.3/main
$ vi postgresql.conf
change #listen_addresses = 'localhost'    to     listen_addresses = '*'

$ vi pg_hba.conf
add line:
host   all  all <ip>/24  md5
<ip> address of the windows client machine

$ cd /etc/init.d
$ ./postgresql restart
 * Restarting PostgreSQL 9.3 database server

Step 3) Add database password to postgres user

$ psql
psql (9.3.4)
Type "help"for help.

postgres=# \password postgres
Enter new password: 
Enter it again:
postgres=# 

Step 4) Open azure server endpoint for port 5432 


Step 5) Windows pgadmin III client connect to postgresql database











No comments:

Post a Comment