CentOS7 PostgreSQL安装配置详解

 时间:2026-02-15 10:54:22

1、准备好yum源,命令:yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm

yum install postgresql94-server postgresql94-contrib

CentOS7 PostgreSQL安装配置详解

CentOS7 PostgreSQL安装配置详解

2、设置开机启动,并启动服务

systemctl enable postgresql-9.4.service

CentOS7 PostgreSQL安装配置详解

3、初始化数据库/usr/pgsql-9.4/bin/postgresql94-setup initdb 然后,

启动数据库:systemctl start postgresql-9.4.service

CentOS7 PostgreSQL安装配置详解

CentOS7 PostgreSQL安装配置详解

4、查看进程是否正常启动,开启远程访问

CentOS7 PostgreSQL安装配置详解

CentOS7 PostgreSQL安装配置详解

5、修改用户密码,用命令su到用户上,如下图

CentOS7 PostgreSQL安装配置详解

6、将postgresq加入防火墙,新建文件/usr/lib/firewalld/services/postgresql.xml如下图操作:

CentOS7 PostgreSQL安装配置详解

CentOS7 PostgreSQL安装配置详解

7、重启服务systemctl restart postgresql-9.4.service,进行基本的数据库操作,就是使用一般的SQL语言

CentOS7 PostgreSQL安装配置详解

  • Centos7安装PostgreSQL方法
  • centos7.5安装postgresql方法
  • linux安装postgresql方法
  • postgresql集群搭建方法
  • windows 下postgresql安装教程
  • 热门搜索
    有关数学的手抄报 快乐英语手抄报内容 校园安全手抄报图片 关于读书的手抄报花边 教师节手抄报内容大全 讲究卫生手抄报 备战期中手抄报内容 爱鸟护鸟手抄报 关于英语手抄报 绿色出行齐步走手抄报