We assume you have installed postgresql on linux, and running.
if we want that postgresql receive connection from other (not localhost), we must setting file pg_hba.conf (ex. /usr/local/pgsql/dataku/pg_hba.conf) ; i have installed on /usr/local/pgsql , and folder dataku.
you must edit file pg_hba.conf :
#############################################################
# 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 10.107.0.0/16 md5
host mydata deklompen 10.100.0.0/16 md5
# IPv6 local connections:
host all all ::1/128 trust
#############################################################
After edit it, you must restart postgresql.
in this case, database mydata can be accessed from ip-address start 10.100.0.1 end 10.100.255.255 ; user database = deklompen ; with md5 encryption.
if you use md5 encryption, you must create a database user with option encryption
ex. createuser new_user -s -E
the default createuser is not encrypted.
Install Postgresql Di Linux
17 years ago

No comments:
Post a Comment