#postgres 설치 참조 : https://wiki.postgresql.org/wiki/Apt
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.5 pgadmin3
#유저 생성
sudo -u postgres createuser -W dojin
#유저 db 생성
sudo -u postgres createdb testdb -O dojin
#쉘 접속
psql testdb
#*.conf 파일 위치
sql -> show config_file;
/etc/postgresql/9.5/main/*.conf
#*.conf 설정법
postgresql.conf
=> address = "*"
pg_hba.conf
=> host all all 0.0.0.0/0 md5
#기타
sudo service postgres [stop/start]
#설치 2 - yum 설치
#https://wiki.postgresql.org/wiki/YUM_Installation
exclude=postgresql*
yum localinstall http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum install postgresql94-server
#data directory
ls /var/lib/pgsql/9.4/data/
#한번만 하면댐.
service postgresql-9.4 initdb
#만약 안된다면
/usr/pgsql-9.4/bin/postgresql94-setup initdb
#auto start .
chkconfig postgresql-9.4 on
#서비스 시작
service postgresql-9.4 start
#삭제
yum erase postgresql94*
댓글 없음:
댓글 쓰기