当前位置:网站首页>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
边栏推荐
- 【判断题】【简答题】【数据库原理】
- ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍
- [exercise 6] [Database Principle]
- Leetcode234 palindrome linked list
- 【Colab】【使用外部数据的7种方法】
- C graphical tutorial (Fourth Edition)_ Chapter 17 generic: genericsamplep315
- Some thoughts on business
- Swift bit operation exercise
- Seven second order ladrc-pll structure design of active disturbance rejection controller
- Image component in ETS development mode of openharmony application development
猜你喜欢
Node. Js: use of express + MySQL
Analysis of the influence of voltage loop on PFC system performance
Application of ncnn neural network computing framework in orange school orangepi 3 lts development board
Huffman coding experiment report
Xctf mobile--app1 problem solving
基于同步坐标变换的谐波电流检测
Analysis of a music player Login Protocol
How to get user location in wechat applet?
Seven second order ladrc-pll structure design of active disturbance rejection controller
Powerful avatar making artifact wechat applet
随机推荐
35道MySQL面试必问题图解,这样也太好理解了吧
Finite State Machine FSM
【计网】第三章 数据链路层(2)流量控制与可靠传输、停止等待协议、后退N帧协议(GBN)、选择重传协议(SR)
luoguP3694邦邦的大合唱站队
Drop down refresh conflicts with recyclerview sliding (swiperefreshlayout conflicts with recyclerview sliding)
mysqlbetween实现选取介于两个值之间的数据范围
[problem exploration and solution of one or more filters or listeners failing to start]
C graphical tutorial (Fourth Edition)_ Chapter 13 entrustment: what is entrustment? P238
解决 System has not been booted with systemd as init system (PID 1). Can‘t operate.
【習題七】【數據庫原理】
Image component in ETS development mode of openharmony application development
ncnn神經網絡計算框架在香柳丁派OrangePi 3 LTS開發板中的使用介紹
[Database Principle and Application Tutorial (4th Edition | wechat Edition) Chen Zhibo] [Chapter IV exercises]
【习题六】【数据库原理】
The foreground uses RSA asymmetric security to encrypt user information
【R】【密度聚类、层次聚类、期望最大化聚类】
基于同步坐标变换的谐波电流检测
并网-低电压穿越与孤岛并存分析
SQL learning notes (I)
Harmonic current detection based on synchronous coordinate transformation