connect pgadmin3 to postgres runnng on server - postgresql

** new to pgadmin and postgress **
my organization uses PostgreSQL on its server with ubuntu os, I try to connect it using pgadmin 3,
these are the stapes I have taken
changed pg_hba.conf using 'sudo nano /etc/postgresql/9.3/main/pg_hba.conf'
changed listen_addresses='*' in postgresql.conf file
sudo ufw allow 5432/tcp
but still, I am unable to connect I get this error from pg admin:
Server doesn't listen
The server doesn't accept connections: the connection library reports could not connect to server: Connection timed out Is the server running on host "103.72.131.155" and accepting TCP/IP connections on port 5432?
how can I fix it,
is there any website which can guide me step by step to connect pgadmin to PostgreSQL.

Related

server refuses connection after enabling ssl on Postgres 14 server on ubuntu 20.04

I am following a couple of online post to enable ssl on Postgres 14 server on ubuntu 20.04. Generate CA and server keys, setup postgresql.conf and pg_hba.conf, also stop and start the Postgres server. show ssl is on.
However sudo -U postgres and psql -h mydomain.com throws error:
psql: error: connection to server at "mydomain.com" (xxx.xxx.xxx.141), port 5432 failed: Connection refused
Is the server running on that host and accepting TCP/IP connections?
It seems that the problem is with pg_hba.conf. What I did is to add the following line at the end of the file, without changing anything else:
hostssl all all 0.0.0.0/0 scram-sha-256 clientcert=verify-full

Connection to remote machine postgresql database

I am trying to connect to a VM ubuntu from my local computer. On the VM I have created a postgresql database. Then I followed all steps that I could find on several tutorial when it comes to allow access for remote connexion to the db:
add host all all 0.0.0.0/0 trust to the pg_hba.conf file
add listen_addresses = '*' to the postgresql.conf file
remove the firewall by executing sudo ufw allow 5432/tcp
restart postresql by executing sudo systemctl restart postgresql
By using the command psql and then \c gives You are now connected to database "postgres" as user "postgres".
I then create a password by executing ALTER USER postgres WITH PASSWORD 'password';
Then I use postico to connect locally. I want to connect with this same default superuser postgres for testing. I use the VM ip address as host, db name is postgres user postgres, password is password and port 5432 as mentioned above.
After trying to connect for a while with the message opening connection to server, the result is:
could not connect to server: Operation timed out
Is the server running on host "***.**.**.***" and accepting
TCP/IP connections on port 5432?
Any help please? I did all steps I could find on many tutorials but still failing to connect.

Connect pgAdmin to PostgreSQL

I'm trying to connect pgAdmin 4 v4.17 to my PostgreSQL v12.1 that is running on a Debian v9 Stretch server.
I got the error could not connect to server: Connection refused (0x0000274D/10061)
I already tried:
run pgAdmin as admnistrator;
set to listen_addresses = '*' ;
Add the line host all all 0.0.0.0/0 md5;
restarted the server;
Use SSH Tunnel with PuTTY;
Using PuTTY i can access to PostgreSQL normally and execute commands, but pgAdmin doesn't connect, any ideas?
Thanks in advance!

Postgres remote connection

Hello I have installed PostgresSQL 11 on CentOS Linux release 7.6.1810.
I have edited files pg_hba.conf
host all all all md5
And postgresql.conf
listen_addresses = '*'
However, following a restart I am unable to connect from pgAdmin with error:
could not connect to server: Connection refused (0x0000274D/10061) Is
the server running on host "10.190.9.130" and accepting TCP/IP
connections on port 5432?
If I run Docker container on the same server with postgres it connects successfully. Has anyone had this issue with a manual postgres install?

TCP/IP Connections with Postgres on Virtual Server

I'm trying to connect my local gui for postgres to a virtual server that I have running postgres.
I can
su postgres_user
Then
pgsql
Here pgsql loads.
When I go to my pg_hba.conf I have
host all all x.x.x.x/24 trust
In postgresql.conf
listen_addresses = 'localhost,x.x.x.x'
I have ubuntu 16 and postgres 9.5
I have the issue when I try to connect I get the error:
could not connect to server: Connection refused...Is the server running on host "hostip" and accepting TCP/IP connections on port 5432.
If you are using linode, you must either whitelist your ip or use putty (in windows) to tunnel postgres to connect to it.
putty tunneling is easier, however more annoying to deal with on a day to day basis
Follow the tutorial here.
here
Note, it's the same for PGAdmin as it is for any gui in windows.