Ubuntu 8.04下安裝PostgreSQL 8.3關鍵之處

來源:互聯網
上載者:User

本人的系統是虛擬機器上的Ubuntu 8.04

1.先去http://www.postgresql.org那裡下個postgreSQL core 8.3.

2.使用命令tar -xvf postgreSQL-8.3.3.tar.bz2 解壓

3.去那個解壓的檔案夾,使用./configure 命令,它將自動檢查系統配置

4.很不幸得是報了一個"c cannot output the executable file"

相關閱讀:Ubuntu下安裝PostgreSQL8.3詳細過程[多圖]

5.然後在網上找了找資料,發現沒有升級libc所以使用命令:sudo apt-get install libc6-dev gcc g++

6.再運行"./configure",卻報了readline library is not found,如果這個錯誤你能解決最好,還有可能報zlib is not found

7.不幸的是我找了2個多小時,下載了無數相關的包,最後以readline5-dev包不能正常安裝告終。

8.所以沒有辦法,只好這樣運行./configure --without-readline --without-zlib

9.然後make

10.下面命令是要加sudo的

make install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data

到了這裡,我們要建立logfile 檔案然後把它拷貝到 /usr/local/pgsql/data/ (好像不拷貝也可以,大家可以試試)

然後切換使用者sudo - postgres

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

最後,你能看到sql 互動介面,大功告成。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.