当前位置:网站首页>Centos 7.9 install PostgreSQL14.4 steps
Centos 7.9 install PostgreSQL14.4 steps
2022-07-31 01:09:00 【auspicious sailing】
PostgreSQLInstallation steps
(1) Environment description
System: Centos 7.9
Software: PostgreSQL 14.4
(2) Software download
https://www.postgresql.org/ftp/source/v14.4/postgresql-14.4.tar.gz
(3) Unzip the database installation package
tar -zxvf postgresql-14.4.tar.gz
(4) Compile
cd postgresql-14.4/./configure --prefix=/usr/local/postgresql
(5) Installation
make && make install
(6) Create directories data, log
mkdir /usr/local/postgresql/datamkdir /usr/local/postgresql/log
(7) Add user postgres and empower
useradd postgreschown -R postgres.postgres /usr/local/postgresql
(8) Modify the system environment variables of the postgres user
su - postgresvi.bash_postgres
Write the following at the end
export PGHOME=/usr/local/postgresqlexport PGDATA=/usr/local/postgresql/dataexport PGLIB=/usr/local/postgresql/libexport PATH=$PATH:$HOME/bin:$PGHOME/binexport LC_ALL=en_US.UTF8export LANG=en_US.UTF8
Make the configuration file take effect
.bash_profile
(9) Initialize the database
su postgres/usr/local/postgresql/bin/initdb -D /usr/local/postgresql/data/
(10) Modify the configuration file
vim /usr/local/postgresql/data/pg_hba.conf
Add a line at the end of the file
host all all 0.0.0.0/0 trust
Description:
TYPE: pg connection method, local: local unix socket, host: tcp/ip connection
DATABASE: specify the database
USER: Specifies the database user
ADDRESS: ip address, which can define a certain host or a certain network segment, 32 means check the entire ip address, which is equivalent to a fixed ip, 24 means only check the first three bits, and the last bit is between 0 and 255any one
METHOD: Authentication method, commonly used are ident, md5, password, trust, reject.
md5 is a commonly used password authentication method.
The password is a plaintext password sent to the database. It is not recommended to use it in a production environment.
trust is that you can log in as long as you know the database user name. It is not recommended to use it in a production environment.
reject is to reject authentication.
(11) Start the service
pg_ctl start -l /usr/local/postgresql/log/pg_server.log
(12) Login to the database
psql -U postgres -d postgrespsql (14.4)Type "help" for help.postgres=#
边栏推荐
- Rocky/GNU之Zabbix部署(1)
- ShardingSphere's public table combat (7)
- "Real" emotions dictionary based on the text sentiment analysis and LDA theme analysis
- TiKV主要内存结构和OOM排查总结
- Dispatch Center xxl-Job
- 蓝牙mesh系统开发三 Ble Mesh 配网器 Provisioner
- ABC 261 F - Sorting Color Balls (reverse pair)
- DOM系列之scroll系列
- typescript16-void
- SWM32 Series Tutorial 6 - Systick and PWM
猜你喜欢
RTL8720DN开发笔记一 环境搭建与mqtt实例
【952. Calculate the maximum component size according to the common factor】
数字图像隐写术之JPEG 隐写分析
Responsive layout vs px/em/rem
【ABAP】MFBF过账到质量检验库存类型Demo
297. 二叉树的序列化与反序列化
九州云获评云计算标准化优秀成员单位
System design. Short chain system design
"Real" emotions dictionary based on the text sentiment analysis and LDA theme analysis
The client series of the DOM series
随机推荐
Rocky/GNU之Zabbix部署(3)
Installation problem corresponding to tensorflow and GPU version
分布式.分布式锁
软件测试工作3年了,谈谈我是如何从刚入门进阶到自动化测试的?
【ABAP】MFBF过账到质量检验库存类型Demo
Typescript14 - (type) of the specified parameters and return values alone
权限管理怎么做的?
ECCV 2022丨轻量级模型架构火了,力压苹果MobileViT(附代码和论文下载)
System design. Short chain system design
Why use high-defense CDN when financial, government and enterprises are attacked?
黄东旭:TiDB的优势是什么?
TiDB 在长银五八消费金融核心系统适配经验分享
ShardingSphere's vertical sub-database sub-table actual combat (5)
VS warning LNK4099: No solution found for PDB
Basic Parameters of RF Devices 1
87. Convert String to Integer
Ticmp - 更快的让应用从 MySQL 迁移到 TiDB
剑指offer17---打印从1到最大的n位数
Detailed explanation of 9 common reasons for MySQL index failure
不用Swagger,那我用啥?