首页 > 数据库技术 > 详细

Centos8安装PostgreSQL

时间:2021-04-24 20:20:58      阅读:26      评论:0      收藏:0      [点我收藏+]

一、前言

官网地址:https://www.postgresql.org/download/linux/redhat/

二、安装

# 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

过程中如果出现错误,请执行:sudo dnf install wget


三、配置

# 切换成 postgres 用户
sudo -i -u postgres
\password


四、远程访问

cd /var/lib/pgsql/13/data

1、修改pg_hba.conf,添加一行到IPv4

host    all             all             0.0.0.0/0            scram-sha-256

2、修改postgresql.conf

  取消#listen_addresses = ‘localhost‘注释

  修改为listen_addresses = ‘*‘

3、重启

systemctl restart postgresql-13.service 

 

Centos8安装PostgreSQL

原文:https://www.cnblogs.com/gaobing/p/14697356.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!