当前位置:网站首页>PostgreSQL installation
PostgreSQL installation
2022-07-03 13:09:00 【liliang950210】
- Get installation package
http://www.postgres.cn/v2/download Download the corresponding source installation package
- Unzip package
Upload the software package to the server directory
decompression :tar xjvf postgresql*.bz2 # Extract to a directory
- Preconfigured
cd potgresql-12.2 # The directory extracted above
./configure --prefix=/opt/pgsql # To be installed to /opt/pgsql
- Compilation and installation
make world
make install-world
- Create installation users
useradd postgres -m
- Create a database data directory and empower the installation user
mkdir /opt/pgsql/data
chown -R postgres:postgres /opt/pgsql/data
- Set the environment variable
su - postgres
vi .bashrc
Add... At the end of the file :
export PGDATA=/opt/pgsql/data
export PGHOME=/opt/pgsql
export PATH=$PATH:$PGHOME/bin
- postgres Initialize database under user
Initdb -D $PGDATA
- Start database
pg_ctl -D $PGDATA start
- Create database
createdb testdb #testdb Name the database
- Log in to the database
psql testdb
Reference resources :http://www.postgres.cn/v2/download
边栏推荐
- Logback 日志框架
- 2022-02-11 practice of using freetsdb to build an influxdb cluster
- ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍
- mysqlbetween实现选取介于两个值之间的数据范围
- Quick learning 1.8 front and rear interfaces
- Huffman coding experiment report
- SSH登录服务器发送提醒
- Application of ncnn neural network computing framework in orange school orangepi 3 lts development board
- 正则表达式
- Quickly learn member inner classes and local inner classes
猜你喜欢

Detailed explanation of the most complete constraintlayout in history

正则表达式

Xctf mobile--app3 problem solving

Brief introduction to mvcc

Image component in ETS development mode of openharmony application development

elk笔记24--用gohangout替代logstash消费日志

【数据挖掘复习题】

Gan totem column bridgeless boost PFC (single phase) seven PFC duty cycle feedforward

Node.js: express + MySQL的使用

4. Wireless in vivo nano network: electromagnetic propagation model and key points of sensor deployment
随机推荐
【数据库原理及应用教程(第4版|微课版)陈志泊】【第四章习题】
Sword finger offer 14- ii Cut rope II
Image component in ETS development mode of openharmony application development
Some thoughts on business
Logback 日志框架
如何在微信小程序中获取用户位置?
Seven habits of highly effective people
【数据库原理及应用教程(第4版|微课版)陈志泊】【第五章习题】
【数据挖掘复习题】
对业务的一些思考
解决 System has not been booted with systemd as init system (PID 1). Can‘t operate.
Sword finger offer 16 Integer power of numeric value
2022-01-27 use liquibase to manage MySQL execution version
Gan totem column bridgeless boost PFC (single phase) seven PFC duty cycle feedforward
Cadre de logback
【数据库原理及应用教程(第4版|微课版)陈志泊】【第七章习题】
Ali & ant self developed IDE
Kotlin - improved decorator mode
SSH login server sends a reminder
(latest version) WiFi distribution multi format + installation framework