How to connect PGSQL from a remote computer?

How to connect PGSQL from a remote computer?

To remotely access a PostgreSQL database, you must set the two main PostgreSQL configuration files:

postgresql.conf
pg_hba.conf

First of all, configure PostgreSQL service to listen on port 65432 on all network interfaces in Windows 7 machine:

open the file postgresql.conf (Manageengine\ServiceDesk\pgsql\data) and sets the parameter

listen_addresses = '*'

Check the network address of the machine and set parameters in pg_hba.conf file (located in the same directory of postgresql.conf) so that postgresql can accept connections from any machine
For example, if the machine has 192.168.56.2 IP address, add in the pg_hba.conf file:

host all all 192.168.56.1/24 md5

this way, PostgreSQL will accept connections from all hosts on the network 192.168.1.XXX.

Restart the application.


                  New to ADSelfService Plus?

                    • Related Articles

                    • Connect to default PGSQL database remotely

                      1. To be able to reach the server remotely you have to add the following line into the file: ManageEngine/ServiceDeskPlus-MSP/pgsql/data/postgresql.conf:   listen_addresses = '*'   2. PostgreSQL, by default, refuses all connections it receives from ...
                    • Unable to start the application due to Pgsql privilege issue

                      ISSUE: Application does not start via both services and command prompt. ERROR TRACE: Serverout: [16:26:36:443]|[05-10-2023]|[com.adventnet.db.adapter.postgres.PostgresDBAdapter]|[SEVERE]|[27]: Exception occurred while obtaining mode of the database| ...
                    • How to connect to the ServiceDesk database?

                      Open command prompt on the server and change the directory to MangeEngine\ServiceDesk\bin, invoke the batch file 'changeDBServer.bat' For MSSQL database  Connect to the query analyzer of the SQL server and execute the queries. For PostgreSQL database ...
                    • How do I convert the database from PGSQL to MSSQL?

                      1. Stop ManageEngine ServiceDeskPlus – MSP service. 2. Take a backup of the existing data and configuration under PGSQL database by following the below steps. Open CMD as an administrator and execute  command to start the data backup. ...
                    • How to Connect to SDP MSP Database ?

                      1. In-Built POSTGRES (PGSQL) : Open a CMD prompt as an administrator and navigate to ManageEngine\ServiceDeskPlus-MSP\pgsql\bin and run the below command From SDP MSP build 10538 , please use the below method. psql -h localhost -U sdpadmin -p 65432 ...