postgresql rpm 安装

考虑到生产环境可能无法联网所以直接采用RPM安装。

下载RPM装包:
http://www.postgresql.org/download/

postgresql94 - PostgreSQL client programs and libraries
postgresql94-contrib - Contributed source and binaries distributed with PostgreSQL
postgresql94-libs - The shared libraries required for any PostgreSQL clients
postgresql94-server - The programs needed to create and run a PostgreSQL server

这四个安装包是必须的。
安装顺序为:
postgresql94-libs
postgresql94
postgresql94-server
postgresql94-contrib

安装命令
rpm -ivh <rpm_package_name>


初始化数据库,默认路径为/var/lib/pgsql/9.0/data
# service postgresql-9.0 initdb

启动服务
# service postgresql-9.0 start
 
END
一些初始的配置
1
连接到数据库,修改管理员密码
# psql -U postgrespostgres=# ALTER USER postgres WITH PASSWORD 'admin';postgres=# \q

2
修改客户端认证配置文件,将METHOD由默认的ident改为md5
# vi /var/lib/pgsql/9.0/data/pg_hba.conf

3
重启服务
# service postgresql-9.0 restart

猜你喜欢

转载自lawrencej.iteye.com/blog/2218742