溫馨提示×

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

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

要怎樣進(jìn)入postgresql數(shù)據(jù)庫

發(fā)布時(shí)間:2020-07-27 10:07:00 來源:億速云 閱讀:259 作者:清晨 欄目:編程語言

不懂要怎樣進(jìn)入postgresql數(shù)據(jù)庫?其實(shí)想解決這個(gè)問題也不難,下面讓小編帶著大家一起學(xué)習(xí)怎么去解決,希望大家閱讀完這篇文章后大所收獲。

啟動(dòng)數(shù)據(jù)庫服務(wù)器(posgres用戶):

[postgres@localhost bin]$ postgres -D /opt/postgresql/data/ > /opt/postgresql/log/pg_server.log 2>&1 &
[1] 4508

當(dāng)然如果設(shè)置了環(huán)境變量

PGDATA=/opt/postgresql/data
export PGDATA

后,可使用pg_ctl工具進(jìn)行啟動(dòng):

[postgres@localhost log]$ pg_ctl start -l /opt/postgresql/log/pg_server.log
pg_ctl: another server might be running; trying to start server anyway
pg_ctl: could not start server
Examine the log output.
[postgres@localhost log]$

當(dāng)然,最簡(jiǎn)的啟動(dòng)方式是:

[postgres@localhost ~]$ pg_ctl start
server starting
[postgres@localhost ~]$ LOG:  database system was shut down at 2011-07-09 13:58:00 CST
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections

 如果要在操作系統(tǒng)啟動(dòng)時(shí)就啟動(dòng)PG,可以在/etc/rc.d/rc.local 文件中加以下語句:

/opt/postgresql/bin/pg_ctl start -l /opt/postgresql/log/pg_server.log -D /opt/postgresql/data

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享要怎樣進(jìn)入postgresql數(shù)據(jù)庫內(nèi)容對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,遇到問題就找億速云,詳細(xì)的解決方法等著你來學(xué)習(xí)!

向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