当前位置:网站首页>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();
至此安装完成!
边栏推荐
猜你喜欢
ShardingSphere之未分片表配置实战(六)
case语句的综合结果,你究竟会了吗?【Verilog高级教程】
In Google Cloud API gateway APISIX T2A and T2D performance test
Dispatch Center xxl-Job
Centos 7.9 install PostgreSQL14.4 steps
typescript13 - type aliases
Xiaohei's leetcode journey: 117. Fill the next right node pointer of each node II
手把手教你配置Jenkins自动化邮件通知
1782. 统计点对的数目 双指针
分布式.幂等性
随机推荐
ECCV 2022丨轻量级模型架构火了,力压苹果MobileViT(附代码和论文下载)
typescript16-void
The difference between 4G communication module CAT1 and CAT4
822. 走方格
typescript10-常用基础类型
系统设计.短链系统设计
android的webview缓存相关知识收集
Jiuzhou Cloud was selected into the "Trusted Cloud's Latest Evaluation System and the List of Enterprises Passing the Evaluation in 2022"
case语句的综合结果,你究竟会了吗?【Verilog高级教程】
斩获BAT、TMD技术专家Offer,我都经历了什么?
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
分布式.分布式锁
ShardingSphere's vertical sub-database sub-table actual combat (5)
Dispatch Center xxl-Job
认识DTU什么是4GDTU设备
typescript12-联合类型
ShardingSphere's public table combat (7)
蓝牙mesh系统开发二 mesh节点开发
Rocky/GNU之Zabbix部署(2)
87. Convert String to Integer