fedora16安装posgresql9方法一。
1.用yum在线安装
2.初始化postgresql数据库
3.启动postgresql数据库
4.开机自动启动
#添加用户和组 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