数据库

 首页 > 数据库 > postgresql > CentOS6.4系统编译安?postgresql

CentOS6.4系统编译安?postgresql

分享到:
【字体:

?U?不多?,直接?始,
1、登陆Centos使用root用?舻锹?br /> 下?postgresql   
#:wget http://go.rritw.com/ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz
解?海?br /> #tar zxvf postgresql-9.2.4.tar.gz
?入解?横岬哪夸?
#cd postgresql-9.2.4
?始??
#./configure
   -----------------------以下是我???r遇到的??----------------------
第一?????:

    configure:error: in'/root/postgresql-9.2.4':

    configure:error: no acceptable C compiler foundin $PATH
原因是?]有GCC安?即可

    #yum -y install gcc
第二???:
    configure: error: readline library not found
少readline?欤?惭b即可
    #yum -y install readline-devel 
第三?????:
    configure: error: zlib library not found
安?zlib
    #yum -y install zlib-devel
也?每??人的???都不一样,??的?r候找到??提示,百度一下,???可以有答案的,我遇到的也就是?三??
-----------------------------------------------------------------------
?利能?以後:
#gmake
#gmake install 
到??就完成安?,接下?砭褪桥渲昧?br /> 2、?境?量(??我使用VIM 文本??器,如果不??氖褂闷渌?木??器也可以的)
#vim .bash_profile
把:PATH=$PATH:$HOME/bin
改为:PATH=$PATH:$HOME/bin:/usr/local/pgsql/bin
保存退出,
??境?量生效:
#. .bash_profile
3、建立???煊??br /> #useradd postgres
更改用?裟夸?(?一步可?)
#vim /etc/passwd

postgres:x:500:500::/home/postgres:/bin/bash
改为
postgres:x:500:500::/usr/local/pgsql:/bin/bash
?h除用?裟夸?:
rm -r /home/postgres
4、初始化????br /> 新建???夸?:
#mkdir /usr/local/pgsql/data
更改?嘞蓿?br /> #chown postgres:postgres /usr/local/pgsql/data
切?Q到????建立的用??br /> #su postgres
$cd /usr/local/pgsql
$initdb -D data/
到?????某跏蓟?屯瓿闪恕?br /> 5、接下?硎窍到y服?樟耍?br />  回到root用?簦?br /> $exit
复制安?目?下的linux文件到/etc/init.d/
?入postgresql的安?目?,(即????使用tar命令解?旱哪夸?)
#cd /root/postgresql-9.2.4
#cp contrib/start-scripts/linux /etc/init.d/postgresql
添加?绦?嘞蓿?br /> #chmod +x /etc/init.d/postgresql
启?????br /> #service postgresql start
Starting PostgreSQL: ok     大功告成了。
?e激?舆?有一步呢,????扉_?C启?樱?br /> #chkconfig --add postgresql
#chkconfig postgresql on
等等好像?少一???|西:
???觳僮鞯?咽酚??文件
#touch /usr/local/pgsql/.psql_history
#chown postgres:postgres /usr/local/pgsql/.psql_history
?y?一下:
#su postgres
$cd
$createdb test
$psql test
test=#create table test(id int);
CREATE TABLE
看?硎峭昝劳瓿闪恕?br /> 每??人的?境不一样,有?的地方?多指教。有???可以留言,很?芬?兔?饩瞿愕???。

分享到:
CentOS64位系统安装postgresqlodbc详细过...
1,64位系统下,postgresql 的psqlodbc驱动下载地址    http://www.postgresql.org/ftp/odbc/versions/src/ 2,64位系统下,安装psqlodbc需要的安装包:     unixODBC-2.3.1.tar.gz     psqlodbc-09.01.0100.tar.gz   3,安装unixODBC     tar zxvf unixODBC-2.3.1.tar.gz     cd unixODBC-2.3.1     ./c...
CentOS6系统中安装Apache+postgresql+PHP...
安装日期:2012.9.18 软件配置如下: CentOS 6.3 Apache httpd 2.2.23 Postgresql 9.2.0 PHP 5.4.7 ImageMagick 6.7.9-6 imagick 3.1.0 RC2 eAccelerator 42067ac phpBB 3.0.11 Drupal 7.15 vsFtpd 2.2.2 ----------------------------------------------------------------------------- 1. CentOS 最小安装,可选项中除中...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……