当前位置:网站首页>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_postgresWrite 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.UTF8Make 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.confAdd a line at the end of the file
host all all 0.0.0.0/0 trustDescription:
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对象
- 蓝牙mesh系统开发二 mesh节点开发
- "Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
- ShardingSphere之垂直分库分表实战(五)
- 【952. Calculate the maximum component size according to the common factor】
- typescript17-函数可选参数
- tensorflow与GPU版本对应安装问题
- 这个项目太有极客范儿了
- WMware Tools installation failed segmentation fault solution
- MySQL——数据库的查,增,删
猜你喜欢
随机推荐
Know what DTU is 4GDTU equipment
MySQL database advanced articles
ROS2系列知识(3):环境配置
Mysql systemized JOIN operation example analysis
图像处理工具设计
How to Add a Navigation Menu on Your WordPress Site
剑指offer17---打印从1到最大的n位数
Preparations for web vulnerabilities
Image processing tool design
解析云原生消息流系统 Apache Pulsar 能力及场景
调度中心xxl-Job
ShardingSphere之水平分库实战(四)
解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
35. Reverse linked list
24. 请你谈谈单例模式的优缺点,注意事项,使用场景
typescript13 - type aliases
ECCV 2022 华科&ETH提出首个用于伪装实例分割的一阶段Transformer的框架OSFormer!代码已开源!
MySQL——数据库的查,增,删
typescript16-void
Responsive layout vs px/em/rem









