CentOS 8安装postgresql 13

安装postgresql

登陆网址:https://www.postgresql.org/download/linux/redhat/
选择postgresql版本和操作系统平台等信息,直接复制命令,依次执行
在这里插入图片描述

# Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Disable the built-in PostgreSQL module:
sudo dnf -qy module disable postgresql

# Install PostgreSQL:
sudo dnf install -y postgresql13-server

# Optionally initialize the database and enable automatic start:
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13

数据安装完成后默认会创建一个名为postgres的linux登录用户,这里进行密码修改

[root@localhost /]# passwd postgres
更改用户 postgres 的密码 。
新的 密码:

修改文件pg_hba.conf
0.0.0.0/0表示任意IP都可以连接数据库

修改文件postgresql.conf
在这里插入图片描述
关闭防火墙

[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost ~]# 

OK,测试远程连接成功
在这里插入图片描述
然后复制一个新的虚拟机,
原虚拟机IP为192.168.60.3,
将新虚拟机IP设置为192.168.60.4
过程不再赘述,配置完成如下
在这里插入图片描述
至此测试环境搭建完成

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

witleo灬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值