http://my.oschina.net/hippora/blog/375292

下载源码并解压

[root@fnddb ~]# wget https://ftp.postgresql.org/pub/source/v9.4.0/postgresql-9.4.0.tar.bz2
[root@fnddb ~]# tar -xjvf postgresql-9.4.0.tar.bz2
[root@fnddb ~]# cd postgresql-9.4.0

开始编译安装

[root@fnddb postgresql-9.4.0]# ./configure
……
checking for library containing shmget... none required
checking for library containing readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure. It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

按照错误提示依次安装依赖包

[root@fnddb postgresql-9.4.0]# yum install readline-devel
[root@fnddb postgresql-9.4.0]# yum install zlib-devel
...

继续

[root@fnddb postgresql-9.4.0]# ./configure
[root@fnddb postgresql-9.4.0]# make
……
All of PostgreSQL successfully made. Ready to install.
[root@fnddb postgresql-9.4.0]# make install
……
PostgreSQL installation complete.

添加用户

[root@fnddb postgresql-9.4.0]# useradd postgres
[root@fnddb postgresql-9.4.0]# passwd postgres
Changing password for user postgres.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.

建立好database cluster目标文件夹

[root@fnddb postgresql-9.4.0]# mkdir /var/lib/pgsql/data -p
[root@fnddb postgresql-9.4.0]# chown -R postgres /var/lib/pgsql

环境变量设置

[root@fnddb postgresql-9.4.0]# su - postgres
[postgres@fnddb ~]$ vi .bash_profile

# postgres
PGDATA=/var/lib/pgsql/data
PATH=/usr/local/pgsql/bin:$PATH
export PGDATA PATH [postgres@fnddb ~]$ . .bash_profile

创建database cluster

[postgres@fnddb ~]$ pg_ctl initdb
...... WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: /usr/local/pgsql/bin/postgres -D /var/lib/pgsql/data
or
/usr/local/pgsql/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

启动数据库实例

设置好PGDATA环境变量后,可以不带-D选项

[postgres@fnddb ~]$ pg_ctl start -l /var/lib/pgsql/pgsql.log
server starting

关闭数据库实例

[postgres@fnddb ~]$ pg_ctl stop
waiting for server to shut down.... done
server stopped

开机自动启动设置

[root@fnddb postgresql-9.4.0]# vi /etc/rc.local

su - c '/usr/local/pgsql/bin/pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/pgsql.log'

postgresql 在linux上的源码安装的更多相关文章

  1. Linux平台下源码安装mysql多实例数据库

    Linux平台下源码安装mysql多实例数据库[root@linux-node1 ~]# netstat -tlunp | grep 330tcp6 0 0 :::3306 :::* LISTEN 6 ...

  2. 在 Ubuntu 上使用源码安装 OpenResty

    镜像下载.域名解析.时间同步请点击 阿里云开源镜像站 本文将介绍如何在 Ubuntu 上使用源码安装 OpenResty. 目标 Ubuntu 18.04 OpenResty 1.19.3.2 安装依 ...

  3. Linux 6.8 源码安装MySQL8.0

    搭建环境说明: 系统版本:Red Hat Enterprise Linux Server release 6.8 (Santiago) 内核版本:Linux 2.6.32-642.el6.x86_64 ...

  4. linux中的源码安装

    前两天自己在笔记本上装了CentOs版本的虚拟机,接着要装Python3,是源码安装的挺费劲,个人总结了一些源码安装的经验,今天在这里给大家分享一下. 1. 首先准备环境,安装必要的编译工具gcc g ...

  5. Linux环境下源码安装PostgreSQL

    1.下载PostgreSQL源码包,并保存到Linux操作系统的一个目录下 2.解压PostgreSQL源码包 :tar zxvf postgresql-9.2.4.tar.gz 或 tar jxvf ...

  6. linux下python3源码安装及卸载

    Linux下Python3的源码编译安装和卸载方法 [日期:2019-06-21] 来源:博客园  作者:wuli潇萧 [字体:大 中 小]     (一)Linux下软件的源码编译安装和卸载方法 L ...

  7. Linux MySQL5.5源码安装

    环境:CentOS7,MySQL5.5 1.MySQL5.5源码下载 Oracle的网站打开较慢,http://mirrors.sohu.com/mysql/这里提供了MySQL的镜像.一般的,Lin ...

  8. [整理]Linux下的源码安装步骤及其功能解释

    源码的安装一般由3个步骤组成:配置(./configure).编译(make).安装(make install). 这时最常用的命令就是这三个--./configure && make ...

  9. linux nginx+php源码安装

    PHP安装 1)下载 wget http://cn2.php.net/distributions/php-5.6.30.tar.gz 2)解压 tar –xf php-5.6.30 3)进入目录 cd ...

随机推荐

  1. 移动端Bug管理工具——Bugtags

    Bugtags介绍 产品说明 Bugtags是为改善移动产品质量而专门打造的测试平台产品. 产品功能 SDK集成简单 一行代码极速集成,完全不影响原有程序结构. 所见即所得提交问题 一键截屏,使用标签 ...

  2. C库 - 常用文件IO函数

    #include<stdio.h> 0. 文件打开关闭FILE *fp = fopen("C:\\a.dat","wb+");fclose(fp); ...

  3. Git Bash 简单操作

    在Windows下使用Git Bash,用的是Linux命令,常用几个文件操作命令如下: Windows命令 Linux命令 意义 cd e:\xxx cd /e/xxx 切换到xxx目录 cd pw ...

  4. drupal中安装CKEditor文本编辑器,并配置图片上传功能

    一.下载: 1.CKEditor模块 2.IMCE模块 二.安装       1.复制: 下载完上面两个模块之后,解压,将解压后整个文件夹,复制粘贴,放到 sites\all\modules下面,个人 ...

  5. MySql 安装报错 :Last Error:Unable to update security. Access denied for user 'root'@'localhost(useing password:YES)

    在网上查了一下,其实这个问题很好解决,. try again 然后current password  mysql是默认密码为空,不要填,记住不要填就ok了

  6. Webdriver的设计模式:Page Object(页面模型)

    设计思想:面向对象,将单个页面所有可能用到元素封装到一个page类中,并提供一些常用的方法,其属性就代表页面元素,普通方法代表对元素所做的操作 以博客园的登录页面为例: import org.open ...

  7. ACM心路

    又到了夏天了,这个季节最容易发春,最近上课效率怎么这么低,哎,,别发春了,好好学习,天天向上,现在想妹子,都是空想,没有什么实际意义,纯属浪费时间,浪费生命,不如节约点时间到学习上,不学无术,到嘴边的 ...

  8. VBS基础篇 - 循环语句(4) - For Each...Next

    VBS基础篇 - 循环语句(4) - For Each...Next   For Each...Next 循环与 For...Next 循环类似.For Each...Next 不是将语句运行指定的次 ...

  9. cmd 下登陆ftp及相关操作

    cmd 下登陆ftp及相关操作 2011-08-09 20:34:28|  分类: 小技巧|字号 订阅 一.举例 假设FTP地址为“ 61.129.83.39”(大家试验的时候不要以这个FTP去试,应 ...

  10. iOS:UIWebView scrollView 的分页滑动问题

    最近在弄一个native webview+html的项目,感觉这种尝试还是挺不错的,特被是适合内容类app.如杂志.电子书等.其实native搭的就是一个框架,主体还是在html的内容上,所以花在ht ...