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

Posted quanweiru

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

[[email protected] usr]# find / -name postgresql.conf

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

 

[[email protected] ~]# 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)

 

[[email protected] ~]# 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

 

[[email protected] ~]# 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

 

[[email protected] ~]# reboot 

 

技术分享图片

以上是关于could not connect to server: Connection refused (0x0000274D/10061)的主要内容,如果未能解决你的问题,请参考以下文章

Xamarin Studio - Could not connect to the debugger

Connecting to 172.16.128.14:22...Could not connec

“psql: could not connect to server: Connection refused” Error when connecting to remote database(示例代

Idea 连接数据库出错Connection to xxx@localhost failed. [08001] Could not create connection to database

Could not connect to Redis at 192.168.0.129:6379: Connection refused

MySql :Could not create connection to database server.