Linux下PostgreSQL安装部署
目录
1、安装环境
2、pg数据库安装包下载
3、安装依赖包
4、安装
5、测试
一、安装环境
- postgresql-16.0
- CentOS-7
二、pg数据库安装包下载
- 下载地址:下载链接 http://www.postgresql.org/ftp/source/
选择自己要安装的版本
三、安装需要的依赖包
- 在安装数据库的Linux上安装以下依赖包:
yum install -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel gcc-c++ openssl-devel cmake
四、安装
- 创建pgsql文件夹,将安装包放到该目录下
[root@localhost opt]# mkdir pgsql
- 解压压缩包
[root@localhost pgsql]# tar -zxvf postgresql-11.1.tar.gz
- 进入解压后的文件夹
[root@localhost postgresql-16.0]# ls
aclocal.m4 config.log configure contrib doc GNUmakefile.in INSTALL meson.build README
config config.status configure.ac COPYRIGHT GNUmakefile HISTORY Makefile meson_options.txt src
- 编译postgresql源码
--prefix 指定pg安装路径
[root@localhost postgresql-1