origoni's Blog from Millky

origoni의 스프링 블로그 입니다.

CentOS 7 + postgresql 9.5 + postgis 2.2



sudo yum install -y https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-2.noarch.rpm
sudo yum install -y postgresql95-server postgresql95-contrib
sudo yum install -y epel-release
sudo yum install -y postgis2_95

/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl enable postgresql-9.5.service
systemctl start postgresql-9.5.service
vi /var/lib/pgsql/9.5/data/pg_hba.conf
host all all 0.0.0.0/0 md5
vi /var/lib/pgsql/9.5/data/postgresql.conf
listen_addresses = '*'
systemctl restart postgresql-9.5.service
 
sudo -i -u postgres
psql

create user 아이디 with password '비밀번호';
create database 데이터베이스명 with encoding='utf-8' owner=아이디;

\connect 데이터베이스명;
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION postgis_tiger_geocoder;

\q (ctrl + d)


#나중에 추가하기
psql -d 데이터베이스명 -U 아이디 -W
psql 데이터베이스명 -c "CREATE EXTENSION postgis";

12/05 2015 13:20:06
C:\Users\Olivia>java -version
back to top