天天看點

postgresql基本使用(一)

版本号:postgresql-9.5.10.tar.bz2

系統:CentOS7 x86_64

解壓:tar -jxvf postgresql-9.5.10.tar.bz2 

cd postgresql-9.5.10 

./configure --prefix=/usr/local/postgres 這個時候可能有各種報錯,應該都是你缺少包(那就yum安裝包)或者少參數(--without-參數)解決 

make install 安裝

make clean 釋放檔案空間

useradd -G postgres postgres 建立這個組與使用者

mkdir /opt/postgres

chown postgres:postgres /opt/postgres

vi /etc/profile添加下邊的東西

PATH=/usr/local/postgres/bin:$PATH

MANPATH=/usr/local/postgres/share/man:$MANPATH

source /etc/profile 儲存檔案

su - postgres

initdb -D /opt/postgres/ 初始化

或者初始化并啟動 pg_ctl -D /opt/postgres/ initdb

psql 進到指令視窗開始幹活兒 一切ok

本文轉自 aklaus 51CTO部落格,原文連結:http://blog.51cto.com/aklaus/2065050

繼續閱讀