Install Postgresql 9.6 on CentOS 7 - goddes4/python-study-wiki GitHub Wiki
Install Postgresql 9.6 on CentOS 7
λ²μ μ λ§λ μ μ₯μ μ€μΉ
# wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
# yum install pgdg-centos96-9.6-3.noarch.rpm
μ€μΉ κ°λ₯ν ν¨ν€μ§ κ²μ
# yum list postgres*
ν¨ν€μ§ μ€μΉ
# yum install postgresql96-server
# vi /var/lib/pgsql/9.6/data/postgresql.conf
λ°©νλ²½ μ€μ
# firewall-cmd --permanent --zone=public --add-port=5432/tcp
# firewall-cmd --reload
DB μμ±
# /usr/pgsql-9.6/bin/postgresql96-setup initdb
μλΉμ€ λ±λ‘ λ° μμ
# systemctl enable postgresql-9.6.service
# systemctl start postgresql-9.6.service
db κ³μ μΆκ°
μ¬μ©μ λ±λ‘
# adduser sentry
sentry μ© κ³μ κ³Ό DB λ₯Ό μμ±νκΈ° μν΄ pgsql ν둬ννΈλ₯Ό ꡬλ
# su postgres
# psql -U postgres
"postgres=#" ν둬ννΈμμ μ¬μ©μμ database λ₯Ό μμ±νκ³ κΆνμ λΆμ¬
# create user sentry;
# create database sentrydb ENCODING 'UTF-8' ;
# GRANT ALL PRIVILEGES ON DATABASE sentrydb TO sentry;
μ¬μ©μ DB μνΈ μ€μ
# \password sentry