Re: [GENERAL] Unable to connect to Postgresql

Поиск
Список
Период
Сортировка
От John Iliffe
Тема Re: [GENERAL] Unable to connect to Postgresql
Дата
Msg-id 201704092033.59846.john.iliffe@iliffe.ca
обсуждение исходный текст
Ответ на Re: [GENERAL] Unable to connect to Postgresql  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On Sunday 09 April 2017 20:07:01 Adrian Klaver wrote:
> On 04/09/2017 03:27 PM, rob stone wrote:
> > Hello John,
> >
> > Just saw this message.
> >
> >> Still set to the default:
> >>
> >> #listen_addresses = 'localhost'         # 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)
> >>
> >> I did change the Unix domain socket directories:
> >>
> >> #unix_socket_directories = '/tmp'       # comma-separated list of
> >> directories
> >> unix_socket_directories = '/tmp,/var/pgsql'     # *****changed from
> >> default
> >> #
> >
> > Your set-up has Apache, PHP and Postgres all running from the same
> > machine.
> > So as far as running from there goes, it is "localhost".
>
> The issue is not localhost, it is the case when John is trying to
> connect without a host specifier and therefore is trying to reach the
> Unix socket.
>
> > There is no requirement to traverse a network. It is all on the same
> > physical machine.
> >
> > Alter your postgresql.conf file and remove the hash so that:-
> >
> > listen_addresses = 'localhost'
> >
> > is explicitly defined. Alter pg_hba.conf so that localhost is declared
> > and let's see what happens.
>
> It will be the same effect, the commented line is just showing that the
> default is 'localhost'. Though, John if you do decide to do this
> remember to restart the server to have the change take effect.

Yes, I learned that lesson years ago!

I have been restarting both Apache and Postgresql and closed the browser on
every change, and have rebooted a few times too, to ensure that all buffers
are not serving stale images.  It only takes a minute and keeps a lot of
egg off my face!

>
> > Cheers,
> > Rob


В списке pgsql-general по дате отправления:

Предыдущее
От: John Iliffe
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql
Следующее
От: rob stone
Дата:
Сообщение: Re: [GENERAL] Unable to connect to Postgresql