Re: Accessing Postgres Server and database from other Machine

From: "Muthukumar(dot)GK" <muthankumar(at)gmail(dot)com>
To: Hemil Ruparel <hemilruparel2002(at)gmail(dot)com>
Cc: Nicklas Avén <nicklas(dot)aven(at)jordogskog(dot)no>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Paul Förster <paul(dot)foerster(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Accessing Postgres Server and database from other Machine
Date: 2020-12-05 07:12:04
Message-ID: CA+rAWgkBuBnksdMKDFDHPmB7XnbLJrA7P8e0V12_7k1BSJ8vQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes. I restarted (Run->Services.msc->Postgresql13->Restart) after config
file.

I can able to connect my postgres server using .net application with help
of below connection string.

NpgsqlConnectionconn =newNpgsqlConnection("Server=127.0.0.1;User Id=postgres;
"+

"Password=Postgresql(at)1;Database=Training;");

but my colleague is facing restriction issue when trying to connect my
postgres server using *my Ip Address*,

NpgsqlConnectionconn =newNpgsqlConnection("Server=192.1xx.xx.50;User Id=
postgres; "+

"Password=Postgresql(at)1;Database=Training;");

Regards

Muthu

On Sat, Dec 5, 2020 at 12:21 PM Hemil Ruparel <hemilruparel2002(at)gmail(dot)com>
wrote:

> Did you restart postgres after changing pg_hba.conf?
>
> On Sat, Dec 5, 2020 at 11:56 AM Muthukumar.GK <muthankumar(at)gmail(dot)com>
> wrote:
>
>> Hi Nicklas,
>>
>> I have added a line "host all all 0.0.0.0/0 md5" in
>> Pg_hba_conf.sample file and restarted postgres server. porstgres port has
>> been added in windows firewall (Windows10)as well. But my colleague is
>> still facing the below error when connecting my postgres server from .net
>> appplication.
>>
>> Error is - no connection could be made because the target machine
>> actively refused it.
>>
>> Regards
>> Muthu
>>
>> On Sat, Dec 5, 2020 at 1:36 AM Nicklas Avén <nicklas(dot)aven(at)jordogskog(dot)no>
>> wrote:
>>
>>>
>>>
>>> On 4 December 2020 17:17:48 CET, Adrian Klaver <
>>> adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>> >On 12/4/20 8:03 AM, Paul Förster wrote:
>>> >> Hi Adrian,
>>> >>
>>> >>> On 04. Dec, 2020, at 16:13, Adrian Klaver
>>> ><adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>> >>> That is the wrong file, the *.sample is the giveaway.
>>> >>
>>> >> hmmm, I'd rather call it essential reference documentation or
>>> >template for automation. It's perfectly well suited to automatically
>>> >strip all comments and then diff the result to ones real world
>>> >postgresql.conf or some other version postgresql.conf file to find
>>> >parameters that have been removed or changed with a new PostgreSQL
>>> >version. This is highly useful for planning migrations and have a quick
>>> >reference what to check for before actually migrating. So for me this
>>> >is much more than just a giveaway.
>>> >>
>>> >
>>> >Yes, but for changing the behavior of a running instance it is the
>>> >wrong
>>> >file and it's extension is a clue.
>>>
>>>
>>> You will prabably also need to change in tge pg_hba.conf file. At least
>>> in linux there is no entry for connections from the outside there. You will
>>> need a "host" entry accepting any ip address or specify what ip your
>>> collegue is connecting from if possible. I have missed this step a few
>>> times and banged my head.
>>>
>>> /Nicklas
>>>
>>
>> On Sat, Dec 5, 2020 at 1:36 AM Nicklas Avén <nicklas(dot)aven(at)jordogskog(dot)no>
>> wrote:
>>
>>>
>>>
>>> On 4 December 2020 17:17:48 CET, Adrian Klaver <
>>> adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>> >On 12/4/20 8:03 AM, Paul Förster wrote:
>>> >> Hi Adrian,
>>> >>
>>> >>> On 04. Dec, 2020, at 16:13, Adrian Klaver
>>> ><adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>> >>> That is the wrong file, the *.sample is the giveaway.
>>> >>
>>> >> hmmm, I'd rather call it essential reference documentation or
>>> >template for automation. It's perfectly well suited to automatically
>>> >strip all comments and then diff the result to ones real world
>>> >postgresql.conf or some other version postgresql.conf file to find
>>> >parameters that have been removed or changed with a new PostgreSQL
>>> >version. This is highly useful for planning migrations and have a quick
>>> >reference what to check for before actually migrating. So for me this
>>> >is much more than just a giveaway.
>>> >>
>>> >
>>> >Yes, but for changing the behavior of a running instance it is the
>>> >wrong
>>> >file and it's extension is a clue.
>>>
>>>
>>> You will prabably also need to change in tge pg_hba.conf file. At least
>>> in linux there is no entry for connections from the outside there. You will
>>> need a "host" entry accepting any ip address or specify what ip your
>>> collegue is connecting from if possible. I have missed this step a few
>>> times and banged my head.
>>>
>>> /Nicklas
>>>
>>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Paul Förster 2020-12-05 09:05:05 Re: Accessing Postgres Server and database from other Machine
Previous Message Hemil Ruparel 2020-12-05 06:50:44 Re: Accessing Postgres Server and database from other Machine