postgresql和postgis外掛安裝
#################################
一、postgresql安裝:
#################################
1、依賴包安裝:
依賴包檢查:
yum install gcc perl-ExtUtils-Embed readline-devel zlib-devel python-devel -y
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' \
perl-ExtUtils-Embed \
readline \
readline-devel \
zlib \
zlib-devel \
python-devel \
gcc \
libaio \
libaio-devel \
make \
gcc-c++ \
openssl \
openssl-devel \
sysstat | grep -i not
依賴包安裝:
yum install perl-ExtUtils-Embed readline readline-devel zlib zlib-devel python-devel gcc gcc-c++ libaio libaio-devel make sysstat openssl openssl-devel -y
2、編譯安裝postgresql:
cd /disk1/soft/postgresql-9.4.4
./configure --prefix=/usr/local/pgsql9.4.4 --with-perl --with-python --with-libxml --with-openssl --with-pam --with-libxslt --with-segsize=4 --with-wal-segsize=64
make
make install
3、編譯安裝contrib:
cd /disk1/soft/postgresql-9.4.4/contrib
make all
make install
#################################
二、postgis安裝:
#################################
1、依賴包編譯安裝:
proj4: proj.4-4.7.0
./configure --prefix=/usr/local/postgis
make
make install
GEOS: geos-3.5.0
./configure --prefix=/usr/local/postgis
make
make install
LibXML2 : libxml2-2.9.2
./configure --prefix=/usr/local/postgis
make
make install
JSON-C : json-c-json-c-0.12
./configure --prefix=/usr/local/postgis
make
make install
GDAL: gdal-2.0.0
./configure --prefix=/usr/local/postgis
make
make install
2、編譯安裝postgis:
./configure --with-pgconfig=/usr/local/pgsql9.4.4/bin/pg_config
./configure --with-pgconfig=/usr/local/pgsql9.4.4/bin/pg_config --with-gdalconfig=/usr/local/postgis/bin/gdal-config \
--with-geosconfig=/usr/local/postgis/bin/geos-config --with-xml2config=/usr/local/postgis/bin/xml2-config \
--with-projdir=/usr/local/postgis --with-jsondir=/usr/local/postgis --with-libiconv=/usr/bin \
--with-raster --with-topology --with-gettext=no
make
make install
#######################
三、資料庫例項安裝
#######################
1、新增動態連結庫:
echo "/usr/local/postgis/lib/" >> /etc/ld.so.conf
ldconfig
2、新增軟連線:
cd /usr/local
ln -s pgsql9.4.4 pgsql
3、新增環境變數:
su - postgres
vi .bash_profile
PATH=$PATH:$HOME/bin:/usr/local/pgsql/bin
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
. .bash_profile
4、安裝啟動:
安裝:
initdb -D /disk1/pg7001
修改配置檔案埠為7001:
vi postgresql.conf
port=7001
啟動:
pg_ctl -D /disk1/pg7001
5、登入測試postgis外掛是否正常:
psql -p 7001
postgres=# create database test;
CREATE DATABASE
postgres=# \c test;
You are now connected to database "test" as user "postgres".
test=# create extension postgis;
CREATE EXTENSION
檢視外掛安裝檢視:
select *from pg_available_extensions;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20625855/viewspace-1845425/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Centos 7 上安裝Postgresql10.5和PostGISCentOSSQL
- window版postgresql安裝orafce外掛SQL
- geoserver PostGIS的安裝和使用Server
- CentOS7安裝PostgreSQL15以及PostGIS3.3CentOSSQLS3
- PostgreSQL外掛SQL
- Redmine外掛的安裝與解除安裝,知識庫外掛安裝。
- postgis安裝手記
- Docker-postgis安裝Docker
- myeclipse 安裝和使用svn外掛Eclipse
- docker安裝rabbitmq和延遲外掛DockerMQ
- retdec 外掛安裝
- Elasticsearch外掛安裝Elasticsearch
- VIM 外掛安裝
- Postgresql + postgis基本操作SQL
- 關於Eclipse 中 svn外掛 和 egit 外掛的安裝EclipseGit
- flash外掛怎麼安裝 電腦安裝flash外掛步驟
- ATOM 安裝外掛
- 如何安裝 Vim 外掛
- ubuntu 常用外掛安裝Ubuntu
- php常用外掛安裝PHP
- Sublime安裝PlantUML外掛
- Sublime使用,安裝外掛
- Python 外掛安裝Python
- vim 外掛的安裝
- vim外掛的安裝
- VS Code外掛安裝
- jmeter下載安裝及外掛安裝JMeter
- 剛安裝的sublime如何安裝外掛
- PostgreSQL外掛彙總SQL
- Eclipse安裝lombok外掛及外掛使用案例EclipseLombok
- Activiti Designer 5.14.1外掛安裝和使用
- vim外掛的安裝方式 -- vim註釋外掛和doxygen函式註釋生成外掛-ctrlp外掛-tabular等號對齊 外掛...函式
- 安裝Maltego預設外掛Go
- 如何給Wordpress安裝外掛
- Sublime 安裝外掛不生效
- vim外掛 NERDTree安裝使用
- 安裝nginx-kafka外掛NginxKafka
- IDEA安裝Scala外掛Idea