PostgreSQL11 MYSQL_postgresql11 安装

postgresql11 有2种安装方法:二进制源码安装  、rpm包安装

wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz

./configure --prefix=/u01/pgsql

make

make install

wget http://download.postgresql.org/pub/repos/yum/testing/11/redhat/rhel-6-x86_64/postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm

wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz

./configure --prefix=/u01/pgsql

make

make install

wget http://download.postgresql.org/pub/repos/yum/testing/11/redhat/rhel-6-x86_64/postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm

wget https://yum.postgresql.org/testing/11/redhat/rhel-6-x86_64/postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm

rpm -ivh postgresql11-libs-11.5-1PGDG.rhel6.x86_64.rpm

rpm -ivh postgresql11-11.5-1PGDG.rhel6.x86_64.rpm

rpm -ivh postgresql11-contrib-11.5-1PGDG.rhel6.x86_64.rpm

rpm -ivh postgresql11-server-11.5-1PGDG.rhel6.x86_64.rpm

不过在上述2中安装方式前都要先建用户和组及目录编辑用户环境变量  严格起来还需要设置sysctl.conf  and limits.conf

groupadd postgres

useradd -g postgres postgres

passwd postgres

mkdir -p /u01/pgsql

chown -R postgres:postgres /u01/pgsql

chmod -R 775 /u01/pgsql

export PGHOME=/u01/pgsql

export PGDATA=/u01/pgsql/data

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

rpm安装完毕以后需要从/usr/local/pgsql-11下的东西拷贝到/u01/pgsql

初始化   initdb

启动postgresql    pg_ctl start

修改网络配置文件pg_hba.conf

host    all             all            192.168.20.0/24          trust     --生产上这样配置是不安全的

修改主配置文件 postgresql.conf

监听地址  listen_addresses = '192.168.20.202'

端口  #port = 5432

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值