当前位置:网站首页>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=#
边栏推荐
- 权限管理怎么做的?
- BOM系列之history对象
- MySQL database constraints, table design
- Solution: Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
- Distributed. Distributed lock
- 不用Swagger,那我用啥?
- DOM系列之scroll系列
- Xiaohei's leetcode journey: 117. Fill the next right node pointer of each node II
- 《实战》基于电商领域的词性提取及其决策树模型建模
- 解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
猜你喜欢
Mysql systemized JOIN operation example analysis
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
ShardingSphere之垂直分库分表实战(五)
System design. Short chain system design
typescript15-(同时指定参数和返回值类型)
Oracle has a weird temporary table space shortage problem
SWM32 Series Tutorial 6 - Systick and PWM
Yolov7实战,实现网页端的实时目标检测
Mysql: Invalid default value for TIMESTAMP
TypeScript在使用中出现的问题记录
随机推荐
Xiaohei's leetcode journey: 104. The maximum depth of a binary tree
MySql data recovery method personal summary
ros2知识:在单个进程中布置多个节点
In Google Cloud API gateway APISIX T2A and T2D performance test
射频器件的基本参数1
typescript16-void
查看zabbix-release-5.0-1.el8.noarch.rpm包内容
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
《实战》基于电商领域的词性提取及其决策树模型建模
金融政企被攻击为什么要用高防CDN?
Why use high-defense CDN when financial, government and enterprises are attacked?
typescript13-类型别名
87. Convert String to Integer
Mini Program - Global Data Sharing
Typescript18 - object type
DOM系列之动画函数封装
ROS2系列知识(3):环境配置
Know what DTU is 4GDTU equipment
Responsive layout vs px/em/rem
倍增、DFS序