溫馨提示×

溫馨提示×

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

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

進入postgresql數(shù)據(jù)庫的方法

發(fā)布時間:2020-07-18 13:57:07 來源:億速云 閱讀:971 作者:清晨 欄目:編程語言

小編給大家分享一下進入postgresql數(shù)據(jù)庫的方法,相信大部分人都還不怎么了解,因此分享這邊文章給大家學習,希望大家閱讀完這篇文章后大所收獲,下面讓我們一起去學習方法吧!

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

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

推薦:postgresql教程

當然如果設置了環(huán)境變量

PGDATA=/opt/postgresql/data
export PGDATA

后,可使用pg_ctl工具進行啟動:

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

當然,最簡的啟動方式是:

[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數(shù)據(jù)庫的方法的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業(yè)資訊頻道!

向AI問一下細節(jié)

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

AI