ubuntu14.04源代码安装postgresql 9.1

ubuntu14.04源代码安装postgresql 9.1

大家好,又见面了,我是全栈君。

项目须要使用gisgraphy,怎奈gisgraphy3.0仅仅支持postgis1.5.因此仅仅能安装老版本号的posgresql和postgis了。从postgis的support matrix图能够看到postgis不同版本号支持的postgresql,

ubuntu14.04源代码安装postgresql 9.1

我安装的是postgresql9.1.14.

1.下载postgresql9.1版本号的源代码,http://www.postgresql.org/docs/9.1/static/install-short.html

2.解压缩,然后切换到解压缩后的目录下

3.执行命令:./configure

  此处可能会出现例如以下错误:

configure: error: readline library not found

我的解决的方法是:安装
libreadline6-dev

 sudo apt-get install libreadline6-dev

问题得到解决

4.执行命令:

  make

  make install

5.验证安装是否成功,输入命令:

ls -l usr/local/pgsql/

假设 bin include lib 和 share都出现,说明成功安装。

ubuntu14.04源代码安装postgresql 9.1

6.设置用户账户

adduser postgres

passwd postgres

输入password

7.创建postgresql 数据文件夹:

mkdir /usr/local/pgsql/data/

chown postgres:postgres /usr/local/pgsql/data
ls -ld /usr/local/pgsql/data

会出现例如以下界面

ubuntu14.04源代码安装postgresql 9.1

8.初始化postgresql数据文件夹

su postgres

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data/

9.验证postgresql数据文件夹

ls -l /usr/local/pgsql/data

出现例如以下界面:

ubuntu14.04源代码安装postgresql 9.1

10.启动pgsql数据库

/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &

cat logfile

出现例如以下界面:

ubuntu14.04源代码安装postgresql 9.1

11.创建postgresql 数据库。并验证安装是否成功

/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

要是出现例如以下界面,则恭喜你,成功安装

ubuntu14.04源代码安装postgresql 9.1

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/115501.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号