广告
返回顶部
首页 > 资讯 > 数据库 >PostgreSQL 9.6.1源码安装
  • 358
分享到

PostgreSQL 9.6.1源码安装

2024-04-02 19:04:59 358人浏览 独家记忆
摘要

RHEL7.2+postgresql9.6.1Requirements softwares1.GNU make version 3.80 or newer is required[root@rhel7 ~]

RHEL7.2+postgresql9.6.1


Requirements softwares

1.GNU make version 3.80 or newer is required

[root@rhel7 ~]# make --version

GNU Make 3.82

Built for x86_64-redhat-linux-gnu

2.You need an ISO/ANSI C compiler (at least C89-compliant). Recent versions of GCC are recommended

[root@rhel7 ~]# gcc --version

gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)

3. tar is required to unpack the source distribution, in addition to either gzip or bzip2.

4.The GNU Readline library is used by default.

readline

readline-devel

libedit

Optional

perl 5.8 or later

python

Kerberos

OpenSSL

OpenLDAP

and/or PAM

Flex 2.5.31 or later

Bison 1.875 or later


useradd pguser

su - pguser

tar -zxvf postgresql-9.6.1.tar.gz


Install

  cd postgresql-9.6.1

  ./configure

    默认安装目录/usr/local/pgsql,可以使用--prefix=path进行修改,./configure --help

 make

    The last line displayed should be:
    All of PostgreSQL successfully made. Ready to install.

 su (使用root安装)

 make install

    PostgreSQL installation complete.

Set the environment variables for pguser

 mkdir /usr/local/pgsql/data #PostgreSQL数据存储目录

 chown pguser:pguser /usr/local/pgsql/data

 export LD_LIBRARY_PATH=/usr/local/pgsql/lib

 export PG_HOME=/usr/local/pgsql

 export PATH=$PG_HOME/bin/:$PATH

 export PGDATA=/usr/local/pgsql/data

Initilize the DBServer

  (使用pguser)

[pguser@rhel7 ~]$ initdb -D /usr/local/pgsql/data
The files belonging to this database system will be owned by user "pguser".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /usr/local/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
perfORMing post-bootstrap initialization ... ok
syncing data to disk ... ok

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:

    pg_ctl -D /usr/local/pgsql/data -l logfile start

Start the DBServer 

[pguser@rhel7 ~]$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &
[1] 13799
[pguser@rhel7 ~]$ ps -ef |grep postgre
pguser   13799  4377  0 12:37 pts/0    00:00:00 postgres -D /usr/local/pgsql/data
pguser   13801 13799  0 12:37 ?        00:00:00 postgres: checkpointer process   
pguser   13802 13799  0 12:37 ?        00:00:00 postgres: writer process   
pguser   13803 13799  0 12:37 ?        00:00:00 postgres: wal writer process   
pguser   13804 13799  0 12:37 ?        00:00:00 postgres: autovacuum launcher process  
pguser   13805 13799  0 12:37 ?        00:00:00 postgres: stats collector process  
pguser   13807  4377  0 12:37 pts/0    00:00:00 grep --color=auto postgre

连接测试

[pguser@rhel7 ~]$ psql --list
                               List of databases
   Name    | Owner  | Encoding |   Collate   |    Ctype    | Access privileges 
-----------+--------+----------+-------------+-------------+-------------------
 postgres  | pguser | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0 | pguser | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pguser        +
           |        |          |             |             | pguser=CTc/pguser
 template1 | pguser | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/pguser        +
           |        |          |             |             | pguser=CTc/pguser
(3 rows)

[pguser@rhel7 ~]$ psql postgres
psql (9.6.1)
Type "help" for help.

postgres=# select version();
                                                 version                                                 
---------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
(1 row)

postgres=# select current_date;
    date    
------------
 2016-12-01
(1 row)

postgres=# \q

官方文档:https://www.postgresql.org/docs/9.6/static/installation.html

您可能感兴趣的文档:

--结束END--

本文标题: PostgreSQL 9.6.1源码安装

本文链接: https://www.lsjlt.com/news/44746.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • PostgreSQL 9.6.1源码安装
    RHEL7.2+PostgreSQL9.6.1Requirements softwares1.GNU make version 3.80 or newer is required[root@rhel7 ~]...
    99+
    2022-10-18
  • PostgreSQL 10.12 安装系列 - 源码安装
    三、     源码安装 3.1. 下载地址: https://www.postgresql.org/ftp/source/       &n...
    99+
    2022-10-18
  • 怎么用源码安装PostgreSQL
    本篇内容介绍了“怎么用源码安装PostgreSQL”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!数据库版本...
    99+
    2022-10-18
  • Linux下PostgreSQL如何源码安装
    这篇文章将为大家详细讲解有关Linux下PostgreSQL如何源码安装,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。 1、首先安装依赖包,避免在安装过程中出现问题 ...
    99+
    2022-10-18
  • postgresql的源码安装及配置使用
    装postgresql非常简单。直接三部曲搞定。./configure --prefix=/usr/local/postgresqlmakemake install创建postgresql的数据目录mkdi...
    99+
    2022-10-18
  • 怎么在CentOS 7.4环境下源码编译安装postgreSQL 11.4
    本篇内容介绍了“怎么在CentOS 7.4环境下源码编译安装postgreSQL 11.4”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希...
    99+
    2022-10-18
  • python3.6.5源码安装
    挨个输入以下命令即可安装(最后一条是用pip3安装ipython,ipython是一个编辑工具,可选)下面两个命令用以启动python3、ipython...
    99+
    2023-01-31
    源码
  • 源码安装mongoDB
    安装步骤:1.准备1.1 显示系统版本[root@centos ~]# cat /etc/redhat-releaseCentOS Linux release 6.4.1406 (Core)1.2 安装基本...
    99+
    2022-10-18
  • 源码安装mysql
    创建mysql组:groupadd mysql创建mysql用户并赋予这个mysq组中,不创建家目录,不允许用户登录。(因为刚刚创建的mysql是虚拟用户,所以不允许登录)useradd mysql -g ...
    99+
    2022-10-18
  • mysql5.7源码安装
    安装依赖包yum -y install gcc gcc-c++ ncurses ncurses-devel cmake下载相应源码包cd...
    99+
    2022-10-18
  • MySQL5.5源码安装
    1.创建运行用户 useradd -M -s /sbin/nologin mysql //新建程序用户并加入mysql组,不允许登陆系统 2.解包 cd ...
    99+
    2022-10-18
  • MySQL源码安装
    1,下载源码安装包 http://dev.mysql.com/downloads/mysql/        &nb...
    99+
    2022-10-18
  • 源码安装 python3
    Linux下默认系统自带python2.6的版本,这个版本被系统很多程序所依赖,所以不建议删除,如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装python3和python2共存 首先去p...
    99+
    2023-01-31
    源码
  • paramiko源码安装
    搭建环境:VMWare+Red Hat Enterprise Linux Server release 6.5 (Santiago)+Python 2.7推荐paramiko源码包相关下载网址:https://github.com/para...
    99+
    2023-06-06
  • 源码安装nodejs8
    作为一名开发者,Node.js 无疑是你需要掌握的技术之一。它是一个基于 JavaScript 的运行时环境,可以让你在服务器端运行 JavaScript 代码。众所周知,Node.js 自带一个 npm 包管理工具,但是当你需要安装一个 ...
    99+
    2023-05-14
  • PHP7.2源码安装
    这篇文章主要介绍了PHP7.2源码安装,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。php有什么特点1、执行速度快。2、具有很好的开放性和可扩展性。3、PHP支持多种主流与非...
    99+
    2023-06-14
  • 如何下载POSTGRESQL源码安装包及实现主机配置
    这篇文章将为大家详细讲解有关如何下载POSTGRESQL源码安装包及实现主机配置,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。一、下载POSTGRESQL源码安装包及主机...
    99+
    2022-10-19
  • Linux 源码安装Python
    下载源码tar包下载地址:https://www.python.org/downloads/我这里下载的 Python-2.7.11.tgz# tar -zxvf Python-2.7.11.tgz进入解压缩后的文件夹# cd Python...
    99+
    2023-01-31
    源码 Linux Python
  • CentOS7源码安装MySQL
    CentOS7源码安装MySQL 1:安装依赖包   执行:yum -y install ncurses-devel gcc-* bzip2-* bison      2:升级cmake工具(我用的是cmake-3.22.0-rc1.ta...
    99+
    2019-12-21
    CentOS7源码安装MySQL
  • centos6.5 源码安装zabbix3.0.8
    1、安装PHP及扩展包rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm yum -y install&nb...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作