前端之家收集整理的这篇文章主要介绍了
postgresql , postgis 安装,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_
301_0@root权限下安装
@H_
301_0@1.安装postgre
sql 和 postgis
@H_
301_0@# apt-get install postgre
sql-8.4 postgre
sql-8.4-postgis
@H_
301_0@2.安装完成后会
自动生成postgres 账号,进入postgres账号
@H_
301_0@#su postgres
@H_
301_0@3.执行p
sql,进入postgres模式
@H_
301_0@#p
sql postgres
@H_
301_0@4.在postgres模式下
修改密码,注意执行语句后以分号结尾,
@H_
301_0@#ALTER USER postgres with PASSWORD ' 123456';
@H_
301_0@执行正常会
显示 ALTER ROLE
@H_
301_0@5.postgres模式下
退出
@H_
301_0@#\q
@H_
301_0@6.在postgres
用户下,非
数据库命令模式,创建需要用的gis0020库
@H_
301_0@p
sql -U postgres -c "CREATE DATABASE gis0020 WITH TEMPLATE = template0 ENCODING = 'UTF8';"
@H_
301_0@createlang -U postgres plpg
sql gis0020
@H_
301_0@p
sql -U postgres -d gis0020 -f /usr/share/postgre
sql/8.4/contrib/postgis.
sql
@H_
301_0@p
sql -U postgres -d gis0020 -f /usr/share/postgre
sql/8.4/contrib/spatial_ref_sys.
sql
@H_
301_0@7.在postgres
用户下,进入gis0020
数据库
@H_
301_0@#p
sql -U postgres -d gis0020
@H_
301_0@8.查看
数据库下的表
@H_
301_0@#\d