Postgresql 11 installation on Centos7

  1. https://www.postgresql.org/download/linux/redhat/
  2. Select version : 11
  3. Select Platform : Redhat Enterprise
  4. Select Archtecture : x86_64
  5. yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

  6. yum install postgresql11

  7. yum install postgresql11-server

  8. default db install

/usr/pgsql-11/bin/postgresql-11-setup initdb
  1. change access control
[root@localhost data]# pwd
/var/lib/pgsql/11/data
[root@localhost data]# vi pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
+ host all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 ident
host replication all ::1/128 ident
[root@localhost data]# vi postgresql.conf
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------

# - Connection Settings -

+ listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories
# (change requires restart)
systemctl enable postgresql-11
systemctl start postgresql-11
[root@localhost data]# firewall-cmd --permantent --zone=public --add-port=5432/tcp
[root@localhost data]# firewall-cmd --permanent --zone=public --add-port=5432/tcp
  1. change postgre password
[root@localhost data]# su - postgres
마지막 로그인: 화 7월 16 19:25:36 KST 2019 일시 pts/1
-bash-4.2$ alter user postgres with password 'abcd'