当前位置:网站首页>Centos 7.9安装PostgreSQL14.4步骤
Centos 7.9安装PostgreSQL14.4步骤
2022-07-31 01:03:00 【auspicious航】
PostgreSQL安装步骤
(1)环境说明
系统:Centos 7.9
软件:PostgreSQL 14.4
(2)软件下载
https://www.postgresql.org/ftp/source/v14.4/postgresql-14.4.tar.gz(3)解压数据库安装包
tar -zxvf postgresql-14.4.tar.gz(4)编译
cd postgresql-14.4/
./configure --prefix=/usr/local/postgresql(5)安装
make && make install(6)创建目录 data、log
mkdir /usr/local/postgresql/data
mkdir /usr/local/postgresql/log(7)增加用户 postgres 并赋权
useradd postgres
chown -R postgres.postgres /usr/local/postgresql(8)修改postgres用户的系统环境变量
su - postgres
vi .bash_postgres在最后写入如下内容
export PGHOME=/usr/local/postgresql
export PGDATA=/usr/local/postgresql/data
export PGLIB=/usr/local/postgresql/lib
export PATH=$PATH:$HOME/bin:$PGHOME/bin
export LC_ALL=en_US.UTF8
export LANG=en_US.UTF8使配置文件生效
. .bash_profile(9)初始化数据库
su postgres
/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data/
(10)修改配置文件
vim /usr/local/postgresql/data/pg_hba.conf在文件最后增加一行
host all all 0.0.0.0/0 trust说明:
TYPE:pg的连接方式,local:本地unix套接字,host:tcp/ip连接
DATABASE:指定数据库
USER:指定数据库用户
ADDRESS:ip地址,可以定义某台主机或某个网段,32代表检查整个ip地址,相当于固定的ip,24代表只检查前三位,最后一 位是0~255之间的任何一个
METHOD:认证方式,常用的有ident,md5,password,trust,reject。
md5是常用的密码认证方式。
password是以明文密码传送给数据库,建议不要在生产环境中使用。
trust是只要知道数据库用户名就能登录,建议不要在生产环境中使用。
reject是拒绝认证。
(11)启动服务
pg_ctl start -l /usr/local/postgresql/log/pg_server.log(12)登录数据库
psql -U postgres -d postgres
psql (14.4)
Type "help" for help.
postgres=# 边栏推荐
- 系统设计.短链系统设计
- MySQL高级-六索引优化
- 蓝牙mesh系统开发三 Ble Mesh 配网器 Provisioner
- MySQL database constraints, table design
- TiDB 在长银五八消费金融核心系统适配经验分享
- 使用PageHelper实现分页查询(详细)
- Thesis understanding: "Designing and training of a dual CNN for image denoising"
- background has no effect on child elements of float
- 图像处理工具设计
- typescript14-(单独指定参数和返回值的类型)
猜你喜欢

Detailed explanation of 9 common reasons for MySQL index failure

Shell programming of conditional statements

Parameter introduction and selection points of wireless module

蓝牙mesh系统开发二 mesh节点开发

孩子的编程启蒙好伙伴,自己动手打造小世界,长毛象教育AI百变编程积木套件上手

MySQL——数据库的查,增,删

MySQL高级-六索引优化

Mini Program - Global Data Sharing

仿牛客网项目总结

297. 二叉树的序列化与反序列化
随机推荐
【952. Calculate the maximum component size according to the common factor】
射频器件的基本参数2
TiDB 在多点数字化零售场景下的应用
MySQL database (basic)
DOM系列之 client 系列
Why use high-defense CDN when financial, government and enterprises are attacked?
This project is so geeky
ELK deployment script---pro test available
typescript14-(单独指定参数和返回值的类型)
无线模块的参数介绍和选型要点
The difference between 4G communication module CAT1 and CAT4
Basic Parameters of RF Devices 2
typescript15-(同时指定参数和返回值类型)
埃拉托斯特尼筛法
Rocky/GNU之Zabbix部署(2)
XSS related knowledge
Mysql:Invalid default value for TIMESTAMP
[C language course design] C language campus card management system
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
typescript12 - union types