pg13.4安装

1:创建用户,用户组

 

groupadd postgres                            

useradd -g postgres postgres 

 

2:root用户,安装依赖包

 

yum install -y bison

yum install -y flex

yum install -y readline-devel

yum install -y zlib-devel

 

3:postgres 创建安装路径和源码包上传路径:

mkdir -p /postgresql-12.4/data

mk

mkdir soft

 

4:上传tar包源码:我上传到/home/postgres/soft,并赋权,解压,

 

5:编译:postgres用户编译即可;

5.1配置选项生成Makefile,默认安装到目录:/home/postgres/postgresql-12.4

./configure --prefix=/home/postgres/postgresql-12.4

 

5.2编译并安装

 make

 make install

  

6:配置相关路径,.bash_profile

export PGHOME=/home/postgres/postgresql-12.4

export PGDATA=/home/postgres/postgresql-12.4/data

PATH=$PATH:$HOME/bin:$PGHOME/bin

 

7:初始化数据库

 

initdb -D /home/postgres/postgresql12.4/data

 

8:修改postgresql.conf,pg_hba.conf

8.1:pg_hba.conf

 

 

 

8.2:postgresq.conf

 

9:启动数据库

psql -U postgres -p 5444

  

10:设置postgres密码

ALTER USER postgres with encrypted password '123456ab!';

 

 

posted @ 2021-09-08 14:57  缘来不是你我  阅读(161)  评论(0)    收藏  举报