CentOS7.5 PostgreSQL yum Install

by 민갤

Server /

설치 방법은 PostgreSQL 홈페이지에서 친절히 알려준다.

저장소 설치

# yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
(... skip ...)
Installed:
  pgdg-centos11.noarch 0:11-2                                           

Complete!

패키지 설치

# yum -y install postgresql11-server
(... skip ...)
Installed:
  postgresql11-server.x86_64 0:11.1-1PGDG.rhel7                                        

Dependency Installed:
  postgresql11.x86_64 0:11.1-1PGDG.rhel7  postgresql11-libs.x86_64 0:11.1-1PGDG.rhel7 

Complete!

초기화

# /usr/pgsql-11/bin/postgresql-11-setup initdb
Initializing database ... OK

자동 시작 설정

# systemctl enable postgresql-11
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-11.service to /usr/lib/systemd/system/postgresql-11.service.

서비스 실행

# systemctl start postgresql-11

계정 비밀번호 변경

# passwd postgres
postgres 사용자의 비밀 번호 변경 중
새  암호:
새  암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

접속

# su postgres
$ psql
psql (11.1)
도움말을 보려면 "help"를 입력하십시오.

postgres=#

버전 확인

postgres=# select version();
                                                 version                               
                  
------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 11.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit
(1개 행)

Author

민갤

민갤

Back-End Developer

꾸잉꾸잉하고 웁니다.

다음글 Docker가 뭐지?

로그인

디코에 오신 것을 환영해요!
전문가들의 수많은 아티클 창고 🤓