PostgreSQL 源代码安装

#创建用户组与必需的包
groupadd postgres && useradd -g postgres postgres
wget https://ftp.postgresql.org/pub/source/v13.7/postgresql-13.7.tar.gz
tar -zxvf postgresql-13.7.tar.gz
mkdir -p /data/postgres/13.7
yum install readline-devel
yum install zlib-devel
yum install gmake
yum install make
yum install gcc

[root@sqlnode206 db]# yum install readline-devel zlib-devel gmake make gcc


#编译安装包,使用postgres用户
#数据库软件放在/data/postgres/13.7
cd ~/postgresql-13.7
./configure --prefix=/data/postgres/13.7/
gmake world
gmake install-world

#初始化数据库,使用postgres用户
#数据文件放在/data/postgres/data
/data/postgres/13.7/bin/initdb -D /data/postgres/data
#执行如下
[postgres@rhel7u9 postgresql-13.7]$ /data/postgres/13.7/bin/initdb -D /data/postgres/data
The files belonging to this database system will be owned by user "postgres".
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.

creating directory /data/postgres/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

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:

    /data/postgres/13.7/bin/pg_ctl -D /data/postgres/data -l logfile start

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值