The PostgreSQL database is installed in Linux Hill, but it can only be accessed locally. If you want to implement remote access, you need to set it manually. The following small series will introduce you to the method of setting up PostgreSQL remote access in Linux. Let's take a look at it.
After installing PostgreSQL database, the default is to only accept local access connection. If you want to access the PostgreSQL database server on other hosts, you need to configure accordingly.
The steps to configure a remote connection to a PostgreSQL database are as simple as modifying pg_hba.conf and postgresql.conf in the data directory.
pg_hba.conf: Configure access to the database,
postgresql.conf: Configure the corresponding parameters of the PostgreSQL database server.
Steps:
1. Modify the pg_hba.conf file to configure the user's access rights (the line at the beginning of # is the comment content):
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# “local” is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0 .0.1/32 trust
host all all 192.168.1.0/24 md5
# IPv6 local connections:
host all all ::1/128 trust
Among them, the seventh clause is the newly added content, which means that all hosts on the network segment 192.168.1.0 are allowed to access the database using all valid database user names, and provide encrypted password verification.
Among them, the number 24 is a subnet mask, which means that the computer access of 192.168.1.0--192.168.1.255 is allowed!
2. Modify the postgresql.conf file to modify the listening mode of the database server to listen for connection requests from all hosts.
Navigate to #listen_addresses=’localhost’. After the PostgreSQL installation is complete, the default is to only accept connection requests from the localhost.
Remove the beginning of the line #, modify the line content to listen_addresses=’*‘ to allow the database server to listen for connection requests from any host
The above is the Linux setting PostgreSQL remote access The method is introduced. If you don't set it, PostgreSQL can only be local to the default, and the function is limited.
There are many reasons for the kernel panic problem in Linux systems, which may be h
We all know that yum is a package manager in the CentOS system for downloading and
of creating a shared folder by SUSE SUSE is a Linux operating system. To share a SUSE file on other
In Linux, although you can enable Java directly, but sometimes you need to enable J
How to install the whois command on the CentOS system
What should I do if the ASUS F81se computer installs Ubuntu 12.04?
Ubuntu closes the discrete graphics card step
Oracle Linux 6.4 accidentally remove VG solution
The method of modifying the /etc/profile file in Linux system
Ubuntu when copying files prompts how to resolve Permission denied?
Linux offline query dictionary method
What should I do if the partition reads and writes error after Debian mounts the mobile hard disk?
Kali Linux crack wifi password with what software is good?
Linux cancels the cp command to overwrite the file prompt method
Restore win8 boot press F8 to enter advanced boot mode
Teach you Vista wallpaper interpolation solution
In-depth discussion of Varnish cache hit rate
Using XPSP2 to simulate 2003 remote multi-user login
Approaching Windows 7 Super Taskbar
Solve the Win8 system disk usage 100% method
What if Win10 System Windows Media Player cannot load subtitles?
Win8 system Excel2013 cancel compatibility check method
How to install sound card driver Sound card driver installation tutorial