[Solved] PostgreSQL Remote Access Error: could not connect to server

1. Turn off the postgresql service first
. 2. If you want postgresql to support remote access, you need to modify the two configuration files in the data folder under the directory

postgresql.conf
Set the value of the listen_addresses item in the file to ‘*’
pg_hba.conf
Add the following configuration under the host all all 127.0.0.1/32 md5 line after the ipv4 configuration of the configuration file, or directly modify this line to the following configuration host all 0.0.0.0/0 trust
If you do not want to allow all IP remote access, You can set 0.0.0.0 in the above configuration items to a specific IP value.
3. Right-click management on my computer-find service-find postgresql service, right-click to start

Read More: