在Ubuntu12.04上安装postgresql9.1和postgis1.5
2012-07-26 15:46
337 查看
安装postgresql
[plain]view plaincopy
sudo apt-get install postgresql-9.1 postgresql-contrib-9.1
其中postgresql-contrib-9.1不是必须要安装的,如果不安装,以后使用pgadmin打开数据库时可能会提示安装以使用啥啥啥功能。嫌麻烦的话就一起安装了吧。
如果要安装其他版本的postgresql,可以用
[plain]
view plaincopy
sudo apt-cache search postgresql
查询
安装postgis
[plain]view plaincopy
sudo apt-get install postgresql-9.1-postgis
该安装的都安装上了, postgresql已经可以使用,如果要建立一个postgis数据库,还要进行下列步骤:
生成postgis模板库
切换到postgres用户[plain]
view plaincopy
sudo su postgres
新建库postgis_template
[plain]
view plaincopy
createdb postgis_template
执行postgis脚本,这些脚本默认在/usr/share/postgresql/9.1/contrib/postgis-1.5下
[plain]
view plaincopy
psql -d postgis_template -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
psql -d postgis_template -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
修改用户密码
[plain]view plaincopy
psql
ALTER USER postgres WITH PASSWORD '111111';
http://blog.csdn.net/wildghost/article/details/7746204
相关文章推荐
- 在Ubuntu12.04上安装postgresql9.1和postgis1.5
- 在ubuntu12.04上安装PostgreSQL9.2 PostGIS2.0 pgrouting2.0
- ubuntu 安装 postgresql9.1
- ubuntu12.04下源码安装PostgreSQL9.2.3
- PostgreSQL、PostGIS安装使用和Shapefile文件的导入
- Ubuntu 12.04下PostgreSQL-9.1安装与配置详解(在线安装)
- PostgreSQL-9.1安装与配置详解(在线安装)
- linunx(ubuntu)安装postgresql并添加postgis支持
- 在windows sever2003 安装postgresql 9.1出现 不能安装 安装后找不到data文件夹 解决办法
- PostgreSQL + PostGIS for Linux 安装(最新版本)
- Ubuntu下手动编译安装PostgreSQL9.1及整合pgadmin 3
- CentOS安装postgresql9.1
- PostgreSQL-9.1安装与配置详解
- CentOS6.0安装PostgreSQL9.1
- postgresql(V-9.1) debian7.x(wheezy)安装过程+配置详解+数据库的基本使用方法
- Linux(Ubuntu)下PostGIS+Postgresql的安装与配置(下)
- PostGreSQL + PostGIS 在windows下安装以及与Arcgis的连接(离线安装)
- 我的postgreSQL安装、PostGIS安装记录
- PostgreSQL+PostGIS安装以及使用
- Centos6.3 下安装postgresql9.1.5和postgis1.5.5(左脑版)