zoukankan      html  css  js  c++  java
  • centos安装postgis

     
    step 1
     
    yum localinstall https://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-7-x86_64/pgdg-centos92-9.2-2.noarch.rpm
     
    step 2
     
    yum install gd gd-devel libtool* autoconf* readline
     
    # vi /etc/yum.repos.d/CentOS-Base.repo
     
    [base] 和[updates] 区段添加:exclude=postgresql*
     
    yum list postgresql*检查postgresql版本是否正确 包含postgresql92所有安装包
     
    yum postgresql92-devel postgresql92-contrib postgresql92.server
     
    /usr/pgsql-9.2/bin/postgresql92-setup initdb
     
    step 3
     
    vi /var/lib/pgsql/9.4/data/postgresql.conf
     
    去掉
     
    listen_addresses
     
    port
     
    password前面的#
     
    并修改
     
    listen_addresses ='*'
     
    vi /var/lib/pgsql/9.4/data/pg_hba.conf
     
    修改
     
    # IPv4 local connections:
     
    host    all             all             127.0.0.1/32            md5
     
    host    all             all             0。0.0.0/0              password
     
    # IPv6 local connections:
     
    host    all             all             ::1/128                 trust
     
    :wq
     
     
    yum -y install epel-release
     
    yum install libxml2-devel
     
    yum install geos-devel
     
    yum install proj-devel
     
    yum install gdal-devel
     
     
    step 4
     
    下载postgis 建议版本为2.1.9dev
     
    解压后进入目录tar -zxf gostgis*
     
    ./ configure --with-pgconfig=/
     
    make
     
    make install
     
     
    step 5
     
    #su  postgres   
     
    -bash-3.2$psql -U postgres   
     
    postgres=#alter user postgres with password 'new password';
     
    CREATE EXTENSION postgis;
     
    连接数据库尝试插入geometry类型的数据
     
     
    step 6
     
    倒入导出数据库
     
    导入:psql -U postgres(用户名)  数据库名(缺省时同用户名) < /data/dum.sql
     
    导出:pg_dump -h localhost -U postgres(用户名) 数据库名(缺省时同用户名)   >/data/dum.sql
  • 相关阅读:
    Asp.net中导出Excel文档(Gridview)
    以太坊难度炸弹是什么?极大抑制矿工继续以POW方式挖矿!
    Solidity语言基础 和 Etherum ERC20合约基础
    BCH/BSV coin split troubleshooting
    比特币学习-Transaction的locktime属性
    在BCH硬分叉后防止重放攻击-2
    在BCH硬分叉后防止重放攻击-1
    区块链硬分叉-软分叉简单了解
    BTC和BCH 区别和联系?
    BCHABC/BCHSV的矛盾所在
  • 原文地址:https://www.cnblogs.com/Micang/p/8659327.html
Copyright © 2011-2022 走看看