手机版
你好,游客 登录 注册
背景:
阅读新闻

CentOS 6.3环境下yum安装PostgreSQL 9.3

[日期:2014-05-15] 来源:Linux社区  作者:zachaway [字体: ]

PostgreSQL 是一种非常复杂的对象-关系型数据库管理系统(ORDBMS),也是目前功能最强大,特性最丰富和最复杂的自由软件数据库系统。有些特性甚至连商业数据库都不具备。这个起源于伯克利(BSD)的数据库研究计划目前已经衍生成一项国际开发项目,并且有非常广泛的用户。

下面记录CentOS 6.3环境下yum安装Postgres 9.3的简要过程。

------------------------------------华丽丽的分割线------------------------------------

PostgreSQL缓存详述 http://www.linuxidc.com/Linux/2013-07/87778.htm

Windows平台编译 PostgreSQL http://www.linuxidc.com/Linux/2013-05/85114.htm

Ubuntu下LAPP(Linux+Apache+PostgreSQL+PHP)环境的配置与安装 http://www.linuxidc.com/Linux/2013-04/83564.htm

Ubuntu上的phppgAdmin安装及配置 http://www.linuxidc.com/Linux/2011-08/40520.htm

CentOS平台下安装PostgreSQL9.3 http://www.linuxidc.com/Linux/2014-05/101723.htm

PostgreSQL配置Streaming Replication集群 http://www.linuxidc.com/Linux/2014-05/101724.htm

------------------------------------华丽丽的分割线------------------------------------

1.查看已安装的包

# rpm -qa|grep postgres

如果已经存在

//卸载

 # rpm -e postgresql92-server-9.2.4-1PGDG.rhel6.i686

# rpm -e postgresql92-contrib-9.2.4-1PGDG.rhel6.i686

# rpm -e postgresql92-9.2.4-1PGDG.rhel6.i686

# rpm -e postgresql92-libs-9.2.4-1PGDG.rhel6.i686

2. yum 安装

yum install http://yum.postgresql.org/9.3/RedHat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
 yum install postgresql93-server postgresql93-contrib

//初始化
 service postgresql-9.3 initdb

开启
 service postgresql-9.3 start或者

/etc/init.d/postgresql-9.3 start

查看安装结果
 
rpm -aq| grep postgres

可以看到
 
[root@i-87-575-VM vmuser]# rpm -aq| grep postgres
 postgresql93-libs-9.3.4-1PGDG.rhel6.x86_64
 postgresql93-contrib-9.3.4-1PGDG.rhel6.x86_64
 postgresql93-9.3.4-1PGDG.rhel6.x86_64
 postgresql93-server-9.3.4-1PGDG.rhel6.x86_64

说明已经安装好了。

3.测试
  [root@i-87-575-VM vmuser]# su - postgres
 -bash-4.1$ psql -l
 默认密码为空,我们需要修改为指定的密码,这里设定为’postgres’。
 -bash-4.1$ psql
 
PostgreSQL 数据库默认会创建一个postgres的数据库用户作为数据库的管理员,默认密码为空,我们需要修改为指定的密码,这里设定为’postgres’。
 # ALTER USER postgres WITH PASSWORD 'postgres';
 # select * from pg_shadow ;

更加详细的信息可以参考 http://www.linuxidc.com/Linux/2014-05/101725.htm

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

本文永久更新链接地址http://www.linuxidc.com/Linux/2014-05/101787.htm

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款