postgresql源码安装

本文详细介绍了在Linux环境下,通过源码安装PostgreSQL数据库的过程,包括创建用户和组、设置安装目录、解决编译问题、完成make及make install、初始化数据库和启动数据库的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、创建用户和组

groupadd postgres

useradd -g postgres postgres

[root@test1 /]# groupadd postgres
[root@test1 /]# useradd -g postgres postgres

2、创建postfresql的安装目录

[root@test1 tmp]# mkdir -p /postgresql/2.6
[root@test1 tmp]# chown -R postgres:postgres /postgresql

3、编译

默认安装在/usr/local/pgsql目录下,可以通过--prefix指定安装目录

./configure --prefix=/postgres/12.6

[postgres@test1 postgresql-12.6]$ ./configure --prefix=/postgres/12.6
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking which template to use... linux
checking whether NLS is wanted... no
checking for default port number... 5432
checking for block size... 8kB
checking for segment size... 1GB
checking for WAL block size... 8kB
checking for gcc... gcc
checking whether the C compiler works... yes
。。。。。。
configure: using CPPFLAGS= -D_GNU_SOURCE 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值