PostgreSQL啟動及相關配置

2021-09-29 06:54:10 字數 743 閱讀 2805

mkdir /home/ssd1/postgresql_data/ #用來儲存postgresql資料庫表中的資料和配置檔案等資訊

chown postgres:postgres /home/ssd1/postgresql_data/ #修改其目錄的操作許可權

su postgres -c '/home/soft/xiangbaigui/postgresql11.5/postgresql/bin/initdb -d /home/ssd1/postgresql_data/'

#建立資料庫集簇

su postgres -c '/home/soft/xiangbaigui/postgresql11.5/postgresql/bin/pg_ctl -d /home/ssd1/postgresql_data/ -m fast start'
預設埠是5432;

postgresql.conf配置檔案中可進行埠修改。

su postgres會出現『』-bash-4.2$『』,而不是user@主機名 + 路徑的顯示方式,原因是在用useradd新增普通使用者時,有時會丟失家目錄下的環境變數檔案:.bash_profile和.bashrc。

檢視 /etc/passwd 檔案,顯示使用者postgres 的資訊

檢視 /home目錄下沒有使用者postgres的目錄

解決:首先新建/home/postgres 目錄,將.bash_profile和.bashrc複製過去。

PostgreSQL 啟動設定

安裝好的 postgresql 設定為自動啟動 進入 postgresql 原始碼解壓出來的目錄,啟動指令碼拷貝到 etc init.d 目錄下,重新命名為 postgresql 8.3.7,cp contrib start scripts linux etc init.d postgresql 8...

其他 postgreSQL相關

還在mysql和postgresql徘徊的同學可以看一下 我主要是被它 1.支援複雜的sql查詢 2.程序機制,比執行緒對多核cpu利用率更高 上面是這樣寫的,沒做個測試 3.bsd開源,以及其他的多個優點 postgresql ubuntu 搭建 有幾個資料庫的概念普及一下 關係型資料庫 sql ...

Postgresql相關問題

系統環境ubuntu 16.04 sudo apt get install postgresql client dpkg l postgresql client 確認安裝到本機 sudo apt get install postgresql apt cache show postgresql 會列出...