0

When attempting to add a server (this is my first install)

Configuration:

postgres 12

centos 7

pgadmin 4

I get

could not connect to server: Permission denied
Is the server running on host "localhost" (::1) and accepting    
TCP/IP connections on port 5432?
could not connect to server: Permission denied
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?

per

SHOW listen_addresses;
listen_addresses 
------------------
localhost

I can network connect from psql

psql -h localhost aps19
psql (12.1, server 9.2.24)
Type "help" for help.

aps19=> 

I am listening on port 5432

I am able to make TCP connections from java from my localhost postgres>psql psql (12.1, server 9.2.24) Type "help" for help.

xxx=> show port   
xxx-> ;
port 
------
5432

per How connect Postgres to localhost server using pgAdmin on Ubuntu?

psql (12.1, server 9.2.24) Type "help" for help.

postgres=# 
postgres=# alter user postgres with password 'postgres';
ALTER ROLE
postgres=# 

also

netstat -a | grep 5432
unix  2      [ ACC ]     STREAM     LISTENING     30611    /tmp/.s.PGSQL.5432
unix  2      [ ACC ]     STREAM     LISTENING     30602    /var/run/postgresql/.s.PGSQL.5432
user939857
  • 377
  • 5
  • 19

1 Answers1

1

use the "ifconfig" cmd to find real docker ip which name is dock0.

And then use it as username to login.

Nick
  • 11
  • 1
  • Or you can try "host.docker.internal" that is the same real docker IP as username to login. – Nick Jul 01 '20 at 09:10