could not connect to server: Connection refused (0x0000274D/10061)

Oracle Linux 6.8 PostgreSQL Server IP: 192.168.10.220

Windows 7 x64 pgAdmin Custom Port IP: 192.168.10.2

 

Unable to connect to server:

 

could not connect to server: Connection refused (0x0000274D/10061)

Is the server running on host "192.168.10.220" and accepting

TCP/IP connections on port 5432?

 

技术分享图片

 

 Oracle Linux 6.8 Server IP: 192.168.10.220

 

[root@localhost usr]# find / -name postgresql.conf

/var/lib/pgsql/10/data/postgresql.conf

 

[root@localhost ~]# vi /var/lib/pgsql/10/data/postgresql.conf

listen_addresses = ‘*‘          # what IP address(es) to listen on;

                                        # comma-separated list of addresses;

                                        # defaults to ‘localhost‘; use ‘*‘ for all

                                        # (change requires restart)

port = 5432                             # (change requires restart)

 

[root@localhost ~]# vi /var/lib/pgsql/10/data/pg_hba.conf

# Add by QWR on 2018-02-20

# IPv4 local connections:

host    all             all             192.168.10.1/24         trust

 

[root@localhost ~]# netstat -a | grep PGSQ 

unix  2      [ ACC ]     STREAM     LISTENING     17881  /tmp/.s.PGSQL.5432

unix  2      [ ACC ]     STREAM     LISTENING     17880  /var/run/postgresql/.s.PGSQL.5432

 

[root@localhost ~]# reboot 

 

技术分享图片

文章来自:https://www.cnblogs.com/quanweiru/p/8455261.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3