Original: http://blog.csdn.net/shuaiwang/article/details/1793294
1.PostgreSQL installation directory, go to the Data folder, open the postgresql.conf file, modify the listen_addresses, as follows
#-Connection Settings-
listen_addresses = ' localhost,123.123.123.123 ' # What IP address (es) to listen on;
# comma-separated List of addresses;
# defaults to ' localhost ', ' * ' = All
# (change requires restart)
port = 5432 # (change requires restart)
Note: Here the ' 123.123.123.123 ' is renamed your IP.
2-Also in the Data folder, open the pg_hba.conf file, modify the following:
# TYPE DATABASE USER cidr-address METHOD
# IPV4 Local connections:
host all 127.0.0.1/32 MD5
host all postgres 123.123.0.0/16 password
# IPV6 Local connections:
#host All:: 1/128 MD5
Note: The ' 123.123.0.0/16 ' here is the network where you allow access to your database, password is the password required to connect to the database; Postgres refers to the user name, all refers to all databases ~
3-to the Control Panel-Administrative Tools-services, restart the PostgreSQL service