美文网首页
CentOS安装Postgresql数据库

CentOS安装Postgresql数据库

作者: yangkunn | 来源:发表于2021-09-08 22:01 被阅读0次

安装服务

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql10-server
sudo /usr/pgsql-10/bin/postgresql-10-setup initdb
sudo systemctl enable postgresql-10
sudo systemctl start postgresql-10

修改postgres用户密码

su - postgres
psql
ALTER USER postgres WITH PASSWORD '123456';

配置远程访问

修改/var/lib/pgsql/10/data/postgresql.conf文件,取消 listen_addresses 的注释,将参数值改为“*”

listen_addresses  = '*'

修改/var/lib/pgsql/10/data/pg_hba.conf文件


# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             0.0.0.0/0               md5
# IPv6 local connections:
host    all             all             ::1/128                 ident

重启服务

systemctl restart postgresql-10.service

相关文章

  • macrobase安装过程中的问题

    macrobase需要安装postgresql数据库环境本次安装环境centos7,在centos7环境下安装po...

  • zabbix简单教程

    [TOC] 安装 说明:系统为centos6.8 安装zabbix3.0LTS版本,数据库使用postgresql...

  • Kong Quick Start

    CentOS 7 安装 配置 Kong 目前支持 PostgreSQL 和 Cassandra,也可以支持无数据库...

  • Atlassian系列之crowd3.34安装

    系统:Centos7.2 crowd版本:3.34 数据库版本:postgresql9.5 用途:在安装了conf...

  • PostgreSQL流复制热备

    一、前提 分别在两台主机上安装好pg数据库,安装过程参考之前文章Centos安装PostgreSQL 二、节点信息...

  • CentOs7 安装 PostgreSQL

    CentOs7 安装 PostgreSQL 13 创建用户和数据库 开启远程访问 修改默认生成的 postgres...

  • psql

    postgresql数据库基本操作 1. 安装 新安装的PostgreSQL数据库还只有 postgres 这个用...

  • 目录

    centos7联网安装postgresql10

  • postgrsql-安装和初步配置

    背景:centos 7.4postgresql 10 安装 确认

  • CentOS 7源码安装PostGIS

    本文认为已安装PostgreSQL9.6,安装步骤如 Centos7安装PostgreSQL9.6。注意,作者将P...

网友评论

      本文标题:CentOS安装Postgresql数据库

      本文链接:https://www.haomeiwen.com/subject/kxdbwltx.html