From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alex Luya <alexander(dot)luya(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: remote connection error:could not connect to server: Connection refused |
Date: | 2015-11-21 15:47:57 |
Message-ID: | 7096.1448120877@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Alex Luya <alexander(dot)luya(at)gmail(dot)com> writes:
> My postgresql 9.4 is installed in centos 6.7,and I have followed this:
> http://www.cyberciti.biz/faq/postgresql-remote-access-or-connection/
> 1,cd /usr/pgsql-9.4/share/
> 2,cp postgresql.conf.sample postgresql.conf
> 3,sudo vi postgresql.conf and add two lines,and save it:
> *listen_addresses = "*"tcpip_socket = true*
Since your netstat results show that the postmaster is still listening
only on "localhost" (the default), the most obvious theory is that you
failed to edit the configuration file that's actually being used.
Assuming you can connect at all, "show config_file;" would be a reliable
way of identifying which file that is. (Almost certainly, it won't be
in /usr/pgsql-9.4/share.)
Also, I do not know what reference you are looking at that suggests
setting "tcpip_socket", but no such configuration parameter has existed
in Postgres in a very long time. If you had edited the active config
file like that, Postgres would have refused to start. Setting
listen_addresses = "*" should be sufficient.
BTW, I do *not* recommend overwriting the config file generated by initdb
with some sample file like that. You'll lose the configuration values
selected by initdb, which typically isn't a good idea.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Shereshevsky | 2015-11-21 17:19:23 | Re: [ADMIN] How to drop stats on table |
Previous Message | Alex Luya | 2015-11-21 15:26:25 | remote connection error:could not connect to server: Connection refused |