Ubuntu上编译安装PostgreSQL
来源:互联网 发布:生命公式1.0软件 编辑:程序博客网 时间:2024/05/16 10:43
0. 安装postgresql需要的 Bison 和 Flex,以及 版本控制工具 git:
$ sudo apt-get install bison flex git
$ sudo groupadd -g 88 postgres
$ sudo useradd -c "PostgreSQL USER" -g 88 -G postgres -s /bin/bash -u 88 postgres
$ sudo mkdir /home/postgres
(经提醒,以下为正确的使用方式)
$ sudo chown postgres /home/postgres
$ sudo chgrp postgres /home/postgres
$ sudo passwd postgres
2. 下载postgresql源代码。
postgres@ubuntu:~$ git clone http://git.oschina.net/pythonshell/postgresql
3. 迁出9.3.5版本的代码
postgres@ubuntu:~$ cd postgresql/
postgres@ubuntu:!/postgresql$ git checkout REL9_3_5
4. 准备编译的目录( /home/postgres/postgres_9_3_5_build )
postgres@ubuntu:~/postgressql$ cd ..
postgres@ubuntu:~$ mkdir postgres_9.3.5_build
5. 准备安装程序的目录 ( /home/pgsql/ )
postgres@ubuntu:~$ mkdir pgsql
6. 运行configure,为编译做准备
postgres@ubuntu:~$ cd postgres_9.3.5_build
postgres@ubuntu:~/postgres_9.3.5_build$ /home/postgres/postgresql/configure --prefix=/home/postgres/pgsql/ --without-readline --without-zlib
其中,如果你安装了readline,可以去掉 --without-readline。
如果你安装了zlib,可以去掉--without-zlib。
7. 开始编译
postgres@ubuntu:~/postgres_9.3.5_build$ make
All of PostgreSQL successfully made. Ready to install.
8. 检查
postgres@ubuntu:~/postgres_9.3.5_build$ make check
=======================
All 136 tests passed.
=======================
All 136 tests passed.
=======================
9. 安装到 /home/postgresql/pgsql 下
postgres@ubuntu:~/postgres_9.3.5_build$ make install
PostgreSQL installation complete.
10. 指定数据存放位置 ( /home/postgres/pgsql/data/ )
postgres@ubuntu:~/postgres_9.3.5_build$ cd ../pgsql
postgres@ubuntu:~/pgsql$ mkdir data
11. 运行postgresql数据库,以及postgresql的命令行交互软件psql
postgres@ubuntu:~/pgsql$ bin/postgres -D data/ >logfile 2>&1 &
postgres@ubuntu:~/pgsql$ bin/createdb test
postgres@ubuntu:~/pgsql$ bin/psql test
0 0
- Ubuntu上编译安装PostgreSQL
- 在Ubuntu上安装PostgreSQL
- ubuntu上PostgreSQL的安装
- PostgreSQL在Ubuntu上安装
- ubuntu下 编译安装postgresql 8.2.5
- 在CentOS上编译安装PostgreSQL
- PostgreSQL在Ubuntu上安装指南
- PostgreSQL在Ubuntu上安装指南
- PostgreSQL在Ubuntu上安装与图形界面
- ubuntu上编译安装R
- Ubuntu上编译安装Kamailio
- ubuntu上编译安装memcached
- ubuntu上编译安装php7
- Ubuntu Linux 下编译安装 PostgreSQL 和 pgAdmin
- 在ubuntu 8.04上安装postgresql 8.3核心
- PostgreSQL 8.4 在Linux(Ubuntu)上的安装 配置
- Ubuntu上安装postgresql-9.3并配置中文排序规则
- ubuntu 上安装最新的postgresql 9.6版本
- 第二十三章 多项目集中权限管理及分布式会话——《跟我学Shiro》
- sql server2008 插入行时报错:单元格的值无效
- 希望这不是未来的你
- 安装python
- python中的__call__特殊函数
- Ubuntu上编译安装PostgreSQL
- UITableView dequeueReusableCellWithIdentifier
- Java基础----BigDecimal
- 还原数据库的sql
- LEETCODE: Subsets
- 百度音乐接口
- Java高质量代码之 — 泛型与反射
- foolbirdfirstfly
- 第二十四章 在线会话管理——《跟我学Shiro》