当前位置:网站首页>rpm安装postgresql12
rpm安装postgresql12
2022-07-31 01:28:00 【看完能不能点赞?】
安装环境:CentOS Linux release 7.3.1611 (Core)
安装pg版本:postgresql12
安装步骤:

文件下载地址:postgresql12-docker19-postgis-Linux文档类资源-CSDN下载
1.安装postgresql lib库(没有找到离线资源,我是用的yum安装方式)
yum install postgresql-libs.x86_64
2.安装四个rpm包(需按顺序执行)
# rpm -ivh postgresql12-libs-12.4-1PGDG.rhel7.x86_64.rpm
# rpm -ivh postgresql12-12.4-1PGDG.rhel7.x86_64.rpm
# rpm -ivh postgresql12-server-12.4-1PGDG.rhel7.x86_64.rpm
# rpm -ivh postgresql12-contrib-12.4-1PGDG.rhel7.x86_64.rpm
3.初始化数据库(将11或者12改成自己的版本)
/usr/pgsql-12/bin/postgresql-12-setup initdb
4.启动数据库
sudo systemctl start postgresql-12
5.查看数据库状态
sudo systemctl status postgresql-12
(sudo systemctl stop postgresql-12 停止命令)
(sudo systemctl restart postgresql-12 重启命令)

6.允许远程工具链接
cd /var/lib/pgsql/12/data/
vi postgresql.conf
取消注释,更改为:listen_addresses = '*'
Esc :wq 保存退出
7.修改ipv4设置
vi /var/lib/pgsql/12/data/pg_hba.conf
host all all 0.0.0.0/0 md5
(trust是免加密,md5是加密)
保存退出

8.修改用户密码
切换到用户sudo -u postgres psql
alter user postgres with password '******';
\q 退出pg用户
9.重启服务
sudo systemctl restart postgresql-12
10.远程访问工具测试(我使用的navicat,测试可用)
安装postgis(总共40个)
将40个rpm文件上传至自己指定的文件夹
rpm -ivh *.rpm --nodeps –force

rpm -qi postgis30_12 查看安装信息

启动服务创建gis扩展
# sudo su – postgres
# psql
# CREATE EXTENSION postgis;
# SELECT PostGIS_version();

至此安装完成!
边栏推荐
- typescript10-常用基础类型
- The difference between 4G communication module CAT1 and CAT4
- ShardingSphere's unsharded table configuration combat (6)
- kotlin中函数作为参数和函数作为返回值实例练习
- 297. 二叉树的序列化与反序列化
- The client series of the DOM series
- 软件测试要达到一个什么水平才能找到一份9K的工作?
- TiDB 操作实践 -- 备份与恢复
- 斩获BAT、TMD技术专家Offer,我都经历了什么?
- Set the browser scrollbar style
猜你喜欢
随机推荐
Solution: Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
typescript15- (specify both parameter and return value types)
TiDB 操作实践 -- 备份与恢复
System design. Short chain system design
The sword refers to offer17---print the n digits from 1 to the largest
Yolov7实战,实现网页端的实时目标检测
typescript9-常用基础类型
系统设计.短链系统设计
Shell变量与赋值、变量运算、特殊变量
想要写出好的测试用例,先要学会测试设计
ROS Action通信
第一学年课程期末考试
设置浏览器滚动条样式
Huawei's "genius boy" Zhihui Jun has made a new work, creating a "customized" smart keyboard from scratch
深度学习可以求解特定函数的参数么?
无线模块的参数介绍和选型要点
MySQL——数据库的查,增,删
调度中心xxl-Job
ros2知识:在单个进程中布置多个节点
射频器件的基本参数1









