刚好Fedroa 16刚出没几天,一并处理好,Redhat(RHEL) 6.x/CentOS 6.0同理。
废话不多说,安装很简单,没几个命令。
#添加用户和组 groupadd postgres useradd postgres -g postgres #下载源码,并且压缩 wget http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.bz2 tar jxvf postgresql-9.1.2.tar.bz2 cd postgresql-9.1.2 #设置postgresql安装路径 ./configure --prefix=/usr/local/pgsql --with-openssl #创建一个保存数据的目录,并且给予postgresql用户权限 mkdir /data/pgsql -p chown -R postgres:postgres /data/pgsql/ #必须用postgres这个帐号执行此命令,指定数据库目录和编码 su postgres -c "/usr/local/pgsql/bin/initdb -D /data/pgsql -E UTF8" #将启动脚本加入到系统服务 cp contrib/start-scripts/linux /etc/init.d/postgresql chmod +x /etc/init.d/postgresql chkconfig --add postgresql #启动postgresql服务 service postgresql start #设置为开机启动 chkconfig postgresql on











