日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux环境下创建postgis数据库,linux下搭建postgresql、postgis、pg_pathman环境步骤详解...

發(fā)布時間:2023/12/4 linux 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux环境下创建postgis数据库,linux下搭建postgresql、postgis、pg_pathman环境步骤详解... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

操作系統(tǒng):centOS6.6

安裝postgreSQL9.6.2

安裝命令:

./postgresql-9.6.3-2-linux-x64.run

之后按照圖形界面操作安裝,語言選擇zh_CN UTF-8

安裝geos-3.6.0(會報錯,暫時不用管)

安裝命令:

tar xjvfgeos-3.6.0.tar.bz2

cd geos-3.6.0

./configure ?–prefix=/opt/geos

make

make install

安裝proj-4.9.3

安裝命令:

tar zxvf proj-4.9.3.tar.gz

cd proj-4.9.3

./configure?–prefix=/opt/proj

make

make install

安裝gdal-2.1.2

安裝命令:

yum install gcc-c++

tar zxvf gdal-2.1.2.tar.gz

cd gdal-2.1.2

./configure?–prefix=/opt/gdal

make

make install

刪除geos相關(guān)的文件夾

cd /opt

rm –rf geos

rm –rf geos-3.6.0

重新安裝geos-3.6.0,步驟如上

安裝postgis

安裝命令:

export LD_LIBRARY_PATH=/opt/PostgreSQL/9.6/lib

export PATH=/opt/PostgreSQL/9.6/bin:$PATH

export MANPATH=/opt/PostgreSQL/9.6/share/man:$MANPATH

tar zxvf postgis-2.3.2.tar.gz

cd postgis-2.3.2

./configure -prefix=/opt/postgis

報錯如下:

checking for xml2-config… no

configure: error: could not find xml2-config from libxml2within the current path. You may need to try re-running configure with a–with-xml2config parameter.

checking for xml2-config… no

configure: error: could not find xml2-config from libxml2within the current path. You may need to try re-running configure with a–with-xml2config parameter.

檢查libxml2的安裝情況:

rpm -qa |grep? libxml2

重新安裝libxml2和libxml2-devel包(需要聯(lián)網(wǎng))

yum install libxml2

yum install libxml2-devel -y

安裝完之后查找xml2-config文件是否存在:

find / -name “xml2-config”

如果輸出結(jié)果如下表示成功:

/usr/bin/xml2-config

繼續(xù)執(zhí)行如下命令:

./configure –prefix=/opt/postgis/–with-pgconfig=/opt/PostgreSQL/9.6/bin/pg_config–with-geosconfig=/opt/geos/bin/geos-config –with-projdir=/opt/proj/–with-gdalconfig=/opt/gdal/bin/gdal-config–with-xml2config=/usr/bin/xml2-config

make

make install

打開postgresql終端執(zhí)行

SELECT name,default_version,installed_version FROM pg_available_extensions WHERE name LIKE’postgis%’ ;

執(zhí)行命令:

cp/opt/geos/lib/libgeos_c.so.1?/opt/PostgreSQL/9.6/lib

執(zhí)行命令:

cp/opt/proj/lib/libproj.so.12 ?/opt/PostgreSQL/9.6/lib

執(zhí)行命令:

cp /opt/gdal/lib/libgdal.so.20?/opt/PostgreSQL/9.6/lib

創(chuàng)建postgis擴展

安裝pg_pathman

安裝命令:

cd /opt

unzippg_pathman-1.2.1.zip

export PATH=/opt/PostgreSQL/9.6/bin:$PATH

cd pg_pathman-1.2.1

cp -r/opt/PostgreSQL/9.6/include/openssl ?/usr/include/

cp -r/opt/PostgreSQL/9.6/include/gssapi ?/usr/include/

make USE_PGXS=1

make USE_PGXS=1install

cd/opt/PostgreSQL/9.6/data/

vimpostgresql.conf

#將shared_preload_libraries注釋取消,將下面變量賦值進去

shared_preload_libraries= ‘pg_pathman,pg_stat_statements’

按esc退出,:wq!保存退出!

重啟數(shù)據(jù)庫服務(wù):

service postgresql-9.6 restart

創(chuàng)建pg_pathman擴展

開啟遠程訪問:

vi /opt/PostgreSQL/9.6/data/postgresql.conf

修改#listen_addresses= ‘localhost’? 為? listen_addresses=’*’

當然,此處‘*’也可以改為任何你想開放的服務(wù)器IP

信任遠程連接

vi /opt/PostgreSQL/9.6/data/pg_hba.conf

修改如下內(nèi)容,信任指定服務(wù)器連接

關(guān)閉防火墻

service iptables stop

chkconfig iptables off

service iptables status

重啟數(shù)據(jù)庫服務(wù):

servicepostgresql-9.6 restart

轉(zhuǎn)載自:https://blog.csdn.net/qq_26629277/article/details/75579166

總結(jié)

以上是生活随笔為你收集整理的linux环境下创建postgis数据库,linux下搭建postgresql、postgis、pg_pathman环境步骤详解...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。