[postgresql] postgresql 安装
生活随笔
收集整理的這篇文章主要介紹了
[postgresql] postgresql 安装
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
APT安裝
sudo apt-get install postgresql postgresql-client-common(注: 我的機器會卡死在 "正在設(shè)置 postgres92 (9.2.0-b1) ...")
源碼安裝
wget http://ftp.postgresql.org/pub/source/v9.2.0beta1/postgresql-9.2beta1.tar.bz2tar -xvf postgresql-9.2beta1.tar.bz2cd postgresql-9.2beta1./configure sudo make && make install服務(wù)配置
# 添加一個postgres用戶 adduser postgres # 創(chuàng)建數(shù)據(jù)存儲目錄 mkdir /usr/local/pgsql/data # 修改owner chown postgres /usr/local/pgsql/data # 切換用戶 su - postgres # 初始化數(shù)據(jù)庫 /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &測試安裝成功與否
# 創(chuàng)建一個數(shù)據(jù)庫 /usr/local/pgsql/bin/createdb test # cli連接 test數(shù)據(jù)庫 /usr/local/pgsql/bin/psql test啟動postgresql服務(wù)(用新建的postgres用戶)
?
?
總結(jié)
以上是生活随笔為你收集整理的[postgresql] postgresql 安装的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: UrlEncode编码算法
- 下一篇: 最新建账年(over partition