当前位置:网站首页>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
边栏推荐
- sitesCMS v3.0.2发布,升级JFinal等依赖
- The upward and downward transformation of polymorphism
- 剑指 Offer 14- I. 剪绳子
- Kotlin notes - popular knowledge points asterisk (*)
- 35道MySQL面试必问题图解,这样也太好理解了吧
- Analysis of the influence of voltage loop on PFC system performance
- Sword finger offer 15 Number of 1 in binary
- 01 three solutions to knapsack problem (greedy dynamic programming branch gauge)
- The difference between session and cookie
- Luogup3694 Bangbang chorus standing in line
猜你喜欢

ncnn神经网络计算框架在香橙派OrangePi 3 LTS开发板中的使用介绍

【数据库原理及应用教程(第4版|微课版)陈志泊】【第四章习题】

Sword finger offer 14- ii Cut rope II

如何在微信小程序中获取用户位置?

Finite State Machine FSM

Application of ncnn Neural Network Computing Framework in Orange Pi 3 Lts Development Board

Xctf mobile--app1 problem solving

高效能人士的七个习惯

Brief introduction to mvcc

Two solutions of leetcode101 symmetric binary tree (recursion and iteration)
随机推荐
Brief introduction to mvcc
【数据库原理及应用教程(第4版|微课版)陈志泊】【SQLServer2012综合练习】
My creation anniversary: the fifth anniversary
Analysis of a music player Login Protocol
2022-01-27 use liquibase to manage MySQL execution version
elk笔记24--用gohangout替代logstash消费日志
IDEA 全文搜索快捷键Ctr+Shift+F失效问题
电压环对 PFC 系统性能影响分析
Glide question you cannot start a load for a destroyed activity
SLF4J 日志门面
C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - using asynchronous
Attack and defense world mobile--ph0en1x-100
Xctf mobile--rememberother problem solving
Tianyi ty1208-z brush machine detailed tutorial (free to remove)
Kotlin - 改良装饰者模式
Express abstract classes and methods
[combinatorics] permutation and combination (the combination number of multiple sets | the repetition of all elements is greater than the combination number | the derivation of the combination number
剑指 Offer 15. 二进制中1的个数
【習題五】【數據庫原理】
Swift bit operation exercise