在linux下的安装postgresql
2 Comments2009年07月29日 作者: 大头刚
1.下载并解压
到官方网站下载安装文件,可以选择编译好的,也可选择源代码安装,本例使用源代码
最新版本是8.3.7(目前到了8.4),下载到安装目录,解压
cd /usr/local/
tar -xzvf postgresql-8.3.7.tar.gz
2.添加postgresql用户
groupadd postgresql
useradd postgresql -g postgresql
mkdir pgsql
chown -R postgresql.postgresql pgsql/
cd postgresql-8.3.7
3.开始编译安装
./configure –prefix=/usr/local/pgsql
make
make install
如果遇到下面报错
configure: error: readline library not found
方法1: 安装该软件包
apt-get install libreadline5 libreadline5-dev
方法2: –without-readline 选项关闭 readline 功能,即:
./configure –prefix=/usr/local/pgsql –without-readline
4.添加环境变量
su - postgresql
cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. [...]
2 Comments so far | 阅读全文 »



