啟動postgresql的方法是什么

小編給大家分享一下啟動postgresql的方法是什么,相信大部分人都還不怎么了解,因此分享這邊文章給大家學(xué)習(xí),希望大家閱讀完這篇文章后大所收獲,下面讓我們一起去學(xué)習(xí)方法吧!

網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、重慶小程序開發(fā)公司、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了井陘免費建站歡迎大家使用!

啟動數(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)行啟動:

[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]$

因為之前已經(jīng)啟動,所以打印“another server might be running”。此時,查看日志,有如下信息:

[postgres@localhost log]$ cat pg_server.log
FATAL:  lock file "postmaster.pid" already exists
HINT:  Is another postmaster (PID 4491) running in data directory "/opt/postgresql/data"?
[postgres@localhost log]$

當(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)啟動時就啟動PG,可以在/etc/rc.d/rc.local 文件中加以下語句:

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

以上是啟動postgresql的方法是什么的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對大家有所幫助,如果還想學(xué)習(xí)更多知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!

文章名稱:啟動postgresql的方法是什么
鏈接地址:http://bm7419.com/article44/geejhe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管搜索引擎優(yōu)化、網(wǎng)站改版、網(wǎng)站導(dǎo)航網(wǎng)站維護(hù)、商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作