惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
I
InfoQ
博客园_首页
G
Google Developers Blog
爱范儿
爱范儿
Last Week in AI
Last Week in AI
量子位
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
月光博客
月光博客
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - osbreak

ros2::tf2 QML::qml与c++数据交互 k8s:: Service 管理 deployment postgresql 索引 postgresql 基本类型 PLSQL 触发器 PLSQL 程序包 PLSQL 执行块 PLSQL 基础数据类型 PLSQL oracle安装部署 mysql事务与隔离 mysql慢查询分析 mysql建增删改查 mysql常用总结 (9)libevent 常用设置 (8)libevent 构建libevent http服务,支持文件下载 (7)libevent filter(过滤器) (6)libevent定时器 (5)libevent evbuffer
postgresql 基础运维
osbreak · 2023-12-13 · via 博客园 - osbreak

CentOS 7安装PGSQL15

1.0 安装依赖

wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libzstd-1.5.5-1.el7.x86_64.rpm
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/llvm5.0-devel-5.0.1-7.el7.x86_64.rpm
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/llvm5.0-5.0.1-7.el7.x86_64.rpm
wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/llvm5.0-libs-5.0.1-7.el7.x86_64.rpm

yum install -y libzstd-1.5.5-1.el7.x86_64.rpm
yum install -y centos-release-scl-rh llvm5*
yum install -y epel-release

1.1 安装

wget --no-check-certificate  https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 
# 安装 PostgreSQL
sudo yum install -y postgresql15-server postgresql15-devel

1.1 初始化

# 初始化DB
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb

# 开机启动|启动|重启|状态|停止 命令
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
sudo systemctl restart postgresql-15
sudo systemctl status postgresql-15
sudo systemctl stop postgresql-15

1.1 配置可连接

/* 切换至postgres用户下,执行psql进入到postgreSQL数据库,出现版本号,代表安装成功。 */
su - postgres
psql 

image

/* 修改默认密码 */
ALTER USER postgres WITH PASSWORD 'command';

vim /var/lib/pgsql/15/data/pg_hba.conf
/* 编辑文件,最后一行添加 */
host    all             all             0.0.0.0/0               md5

vim /var/lib/pgsql/15/data/postgresql.conf
/* 修改listen_addresses值 */
listen_addresses = '*'