千家信息网

CentOS 7.5 1804 yum 安装 Postgre

发表于:2025-02-19 作者:千家信息网编辑
千家信息网最后更新 2025年02月19日,一、准备工作:1.postgresql官网:https://www.postgresql.org2.下载页面:https://www.postgresql.org/download/3.Red Hat
千家信息网最后更新 2025年02月19日CentOS 7.5 1804 yum 安装 Postgre

一、准备工作:
1.postgresql官网:https://www.postgresql.org
2.下载页面:https://www.postgresql.org/download/
3.Red Hat家族Linux(包括CentOS/Fedora/Scientific/Oracle)下载页面:https://www.postgresql.org/download/linux/redhat/
4.本文使用系统为:centos 7.5 1804
5.可以使用一下网址找到对应的postgresql yum安装版本 页面:
https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
二、系统执行命令:
1.yum install -y https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

  1. yum -y install postgresql11
  2. yum -y install postgresql11-server
  3. /usr/pgsql-11/bin/postgresql-11-setup initdb
  4. systemctl enable postgresql-11
  5. systemctl start postgresql-11
    三、开通PostgreSQL端口(如果防火墙关闭可以忽略此步骤)
  6. firewall-cmd --zone=public --add-port=5432/tcp --permanent
  7. firewall-cmd --reload
  8. firewall-cmd --list-ports
    四、设置postgres的密码
    Last login: Fri Jul 19 17:13:49 CST 2019 on pts/0
    -bash-4.2$ psql -U postgres
    psql (11.4)
    Type "help" for help.

postgres=# ALTER USER postgres with encrypted password 'welcome1';
ALTER ROLE
postgres=# \q
-bash-4.2$ exit
logout
五、设置远程访问
命令:
vim /var/lib/pgsql/11/data/postgresql.conf
打开后找到:listen_addresses修改为:
listen_addresses = ''
要监听的IP地址;以逗号分隔的地址列表;默认为'localhost';对所有人使用'
'。修改完毕后保存关闭。

命令:
vim /var/lib/pgsql/11/data/pg_hba.conf
打开后文本新增内容如下:
host all all 0.0.0.0/0 md5
修改完成后保存关闭编辑。

六。重启postgres 数据库
systemctl restart postgresql-11

命令 页面 地址 系统 内容 家族 密码 所有人 数据 数据库 文本 步骤 版本 端口 网址 逗号 防火墙 准备 工作 监听 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 提出传感网络技术 电子显示屏网络安全自查报告 丹江口互联网软件开发服务保障 中天城投集团软件开发招聘 linux服务器修改网段 ux设计师和软件开发者 南川区工商软件开发流程特点 我的世界国服租赁服务器 龙族幻想服务器怎么赚钱 山西公安厅网络安全执法 网络技术开发增值税税率 空明网络技术 网络安全等级保护测评项 有没有软件开发平台 广州腾科网络技术有限公司 网络安全认识不到位的体现 网狐服务器管理工具 杭州悦岚网络技术有限公司 数据库的锁怎样保障安全 拼团app软件开发 炫舞时代服务器繁忙 网络安全与执法专业视力要求 软件开发机构指导软件开发过程 江苏新一代软件开发设施厂家现货 灵瑞网络技术有限公司怎么样 我的世界国服租赁服务器 提供mysql数据库服务 和龙软件开发有哪些公司 计算机网络安全入门书 广汽传祺智能服务器
0