源码安装Postgresql9.4.1

1.先到官网下载http://www.postgresql.org/ftp/source/v9.4.1/ tar包

2.解压后执行:

 sudo apt-get install zlib1g-dev

 sudo apt-get install libreadline-dev

3.

./configure

  make
  su
  make install

4.安装完成后程序目录在/usr/local/pgsql/

5、切换到postgres用户编辑~/.bash_profile文件,将数据库执行命令的目录加入到PATH变量。

PATH=$PATH:$HOME/bin:/usr/local/pgsql/bin     //修改~/.bash_profile文件的PATH变量一行,修改后用source使其立即生效,也可以重新登录。

6、初始化以及启动数据库。

[[email protected] ~]$ initdb -D /usr/local/pgsql/data                          //初始化postgresql数据库
[[email protected] ~]$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &        //启动postgresql数据库

在安装完成以后,postgresql.conf的默认配置如下:

如果我们需要停止postgresql服务,可以使用如下命令:

[[email protected] ~]$ pg_ctl stop -D /usr/local/pgsql/data

我们也可以将源码包里contrib/start-scripts/linux启动脚本文件拷贝到/etc/init.d目录中,将其命名成postgresql-9.4

以后就可以就像启动其他服务一样进行启动了,也可以将其加入到开机启动。一般来讲此脚本我们可能需要修改的选项如下图所示:

最后我们将postgresql-9.4加入到开机启动项,可以使用如下命令:

[[email protected] ~]# chkconfig --level 35 postgresql-9.4 on
时间: 2024-08-07 04:28:22

源码安装Postgresql9.4.1的相关文章

centos环境源码安装postgresql9.4

源码安装简要步骤 下载PostgreSQL 源码包  下载根目录地址:http://ftp.postgresql.org/  本人选择的是当前最新版本v9.4.1:http://ftp.postgresql.org/pub/source/v9.4.1/  本人下载的源码压缩包地址如下: $ /usr/local/postgresql 1 解压源码包 $ tar -zxvf postgresql-9.4.1.tar.gz 1 进入解压后的目录 $ cd postgresql-9.4.1 1 开始编

CentOS6.5 64位下源码安装PostgreSQL9.5.1

1.官方下载源码文件 http://www.postgresql.org/ftp/source/v9.5.1/ 2.添加用户 [[email protected] ~]#  useradd postgres [[email protected] ~]#  passwd postgres Changing password for user postgres. New password: Retype new password: passwd: all authentication tokens

源码安装Postgresql9.5

Postgresql简介: PostgreSQL是一个功能强大,开源对象关系型数据库系统.它拥有超过15年的持续开发和经验证的体系结构,赢得了良好的声誉:可靠性,数据完整性和正确性 官方号称: PostgreSQL: The world's most advanced open source database 官网下载地址:https://www.postgresql.org/download/ Postgresql部署: 环境: [[email protected] ~]# cat /etc/

Postgresql源码安装

以在64位CentOS6.5操作系统上源码安装postgresql-9.6beta1为例 一.进入官网下载代码(postgresql-9.6beta1.tar.gz) https://www.postgresql.org 二.将源码上传到服务器/home/alian目录下 可以在windows安装ssh或xftp工具,也可以在CentOS安装lrzsz的rpm包(使用rz,sz命令)上传或下载文件. 三.将源码在当前目录下解压 [[email protected] alian]# tar xzv

pgrouting源码安装说明

1.前提条件: CentOS Linux release 7.2.1511 (Core) X64 postgresql-9.6.1 源码安装 postgis-2.3.0 源码安装 修改环境变量文件 vi /etc/profile export LD_LIBRARY_PATH=/opt/pgsql/9.6.1/lib:/usr/local/lib:/usr/local/lib64 export PATH=/opt/pgsql/9.6.1/bin:$PATH export MANPATH=/opt/

ubuntu14.04源码安装postgresql 9.1

项目需要使用gisgraphy,怎奈gisgraphy3.0只支持postgis1.5.因此只能安装老版本的posgresql和postgis了,从postgis的support matrix图可以看到postgis不同版本支持的postgresql, 我安装的是postgresql9.1.14. 1.下载postgresql9.1版本的源码,http://www.postgresql.org/docs/9.1/static/install-short.html 2.解压缩,然后切换到解压缩后的

centos7.2源码安装openssl1.0.2

centos7.2默认是安装了opensll软件包的,但是部署个别服务时,由于版本太低.会影响服务的正常部署.只能使用源码安装提高openssl软件版本. 因为之前有openssl软件包,所以要先移除之前版本: 删除旧版本: yum remove -y openssl openssl-devel 源码安装openssl需要perl环境编译,如果没有perl环境还是需要安装: yum -y install perl perl-devel 现在新版本openssl: wget https://www

centos6.5 64 源码安装redis服务,建立可远程连接的redis数据库

安装环境:centos6.5 64位 使用的包:redis-2.8.19.tar.gz  tcl8.6.3-src.tar.gz 包的下载链接:http://downloads.sourceforge.net/tcl/tcl8.6.3-src.tar.gz http://download.redis.io/releases/redis-2.8.19.tar.gz 本次安装的目录/home/hadoop/redis为任意目录 代码实现: 1,安装需要的支持环境 su root cd /home/h

ubuntu php5.6源码安装

今天又花了一天时间装了php,感觉php的源码安装也挺麻烦的,整个过程各种报错. 下篇文章准备整合所有查找到的报错和解决方法. php和nginx一样,在安装前需要装一堆的依赖.有libmcrypt.mcrypt.mhash.其实远不止这三个包,在后面的configure和make中还会陆陆续续安装一些依赖. 1.安装libmcrypt.mcrypt.mhash(整个过程都在/usr/local/src/php目录下) #创建/usr/local/src/php目录并进入mkdir /usr/l