当前位置:网站首页>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();
至此安装完成!
边栏推荐
猜你喜欢
297. 二叉树的序列化与反序列化
Teach you how to configure Jenkins automated email notifications
typescript10-常用基础类型
MySQL (6)
Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar
【Mysql】——索引的深度理解
Ticmp - 更快的让应用从 MySQL 迁移到 TiDB
Word/Excel 固定表格大小,填写内容时,表格不随单元格内容变化
内网渗透——提权
The Meta Metaverse Division lost 2.8 billion in the second quarter, still want to continue to bet?Metaverse development has yet to see a way out
随机推荐
MySQL——数据库的查,增,删
关于Redis相关内容的基础学习
聚簇索引和非聚簇索引到底有什么区别
typescript13 - type aliases
斩获BAT、TMD技术专家Offer,我都经历了什么?
I have been working in software testing for 3 years, how did I go from just getting started to automated testing?
Parameter introduction and selection points of wireless module
SQLserver查询最近三个月的数据,语句该怎么写sqlserver
ROS Action communication
typescript12 - union types
Typescript18 - object type
case语句的综合结果,你究竟会了吗?【Verilog高级教程】
The sword refers to offer17---print the n digits from 1 to the largest
MySql data recovery method personal summary
《实战》基于电商领域的词性提取及其决策树模型建模
MySQL高级-六索引优化
分布式.幂等性
typescript16-void
VS warning LNK4099: No solution found for PDB
《实战》基于情感词典的文本情感分析与LDA主题分析