root权限下安装
1.安装postgresql 和 postgis
# apt-get install postgresql-8.4 postgresql-8.4-postgis
2.安装完成后会自动生成postgres 账号,进入postgres账号
#su postgres
3.执行psql,进入postgres模式
#psql postgres
4.在postgres模式下修改密码,注意执行语句后以分号结尾,
#ALTER USER postgres with PASSWORD ' 123456';
执行正常会显示 ALTER ROLE
5.postgres模式下退出
#\q
6.在postgres用户下,非数据库命令模式,创建需要用的gis0020库
psql -U postgres -c "CREATE DATABASE gis0020 WITH TEMPLATE = template0 ENCODING = 'UTF8';"
createlang -U postgres plpgsql gis0020
psql -U postgres -d gis0020 -f /usr/share/postgresql/8.4/contrib/postgis.sql
psql -U postgres -d gis0020 -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql
#psql -U postgres -d gis0020
8.查看数据库下的表
#\d
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。