"Go" PostgreSQL IP address access configuration

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.