I'm trying to setup a PostgreSQL database on an Ubuntu machine. I would like to be able to access it using pgAdmin3 from a remote machine. How do I setup this?
I have installed the PostgreSQL database on Ubuntu using:
sudo apt-get install postgresql
In my /etc/postgresql/9.1/main/pg_hba.conf
have I this line:
host all all all password
so it should accept connections from all IPv4-addresses and passwords should be sent in clear text (this is for development reasons).
If I run this command to see what services is running:
sudo netstat -tulpn
I can see these lines, that is showing that PostgreSQL is accepting connections on the default port:
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN
3561/postgres
When I try to connect to this PostgreSQL server from a remote computer on the same local network I get this error message:
Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused Is the server running on host "10.0.1.7" and accepting TCP/IP connections on port 5432?
I used postgres
as username and no password. But I have also tried with postgres
as password. On the local server I can login using:
sudo -u postgres psql postgres
How can I connect to a PostgreSQL database running on Ubuntu from a remote machine using pgAdmin3?