Wahaz
Wahaz

Reputation: 17

Error connection pgadmin 4

I add a server and there are Error like this image

I use pgadmin4

How I can Fix this?

Upvotes: 0

Views: 1014

Answers (1)

Duc Filan
Duc Filan

Reputation: 7157

Firstly, check if the server is listening. Use the following command on your server:

netstat -nlt|grep :5432

If it's ok, SSH (or whatever method you use to access the server) to your server and view the file:

/etc/postgresql/9.1/main/postgresql.conf

Find the line start with:

listen_addresses=

If the value after "=" is 'localhost', it means that you cannot connect from outside. To be able to do so, change it to:

listen_addresses='*'

Now you will be able to connect from anywhere, outside from the server itself. And, don't forget to restart you DBMS and check if it works.


Ah. One more thing, you may also need to give your user access rights to your database as well.

Open the file:

/etc/postgresql/9.1/main/pg_hba.conf

And add:

host all all * md5

You also need to restart you DBMS to fire up changes.


P/s: You should enable SSL.

Upvotes: 1

Related Questions