溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

postgresql基本使用(一)

發(fā)布時(shí)間:2020-07-15 21:04:02 來源:網(wǎng)絡(luò) 閱讀:1004 作者:aklaus 欄目:關(guān)系型數(shù)據(jù)庫

官網(wǎng)找到適合自己的版本并下載postgresql https://www.postgresql.org/download/

版本號(hào):postgresql-9.5.10.tar.bz2
系統(tǒng):CentOS7 x86_64

解壓:tar -jxvf postgresql-9.5.10.tar.bz2
cd postgresql-9.5.10
./configure --prefix=/usr/local/postgres 這個(gè)時(shí)候可能有各種報(bào)錯(cuò),應(yīng)該都是你缺少包(那就yum安裝包)或者少參數(shù)(--without-參數(shù))解決
make install 安裝
make clean 釋放文件空間
useradd -G postgres postgres 創(chuàng)建這個(gè)組與用戶
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/ 初始化
或者初始化并啟動(dòng) pg_ctl -D /opt/postgres/ initdb
psql 進(jìn)到命令窗口開始干活兒 一切ok

                另外可以安裝man 跟doc 好像是  make install-man ;make install-doc;安裝完成以后就可以 man psql查看幫助。
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI