PostgreSQL数据库管理系列之一——安装
Linux平台下的安装
我们知道在Linux系统下安装软件有两条路可以走,一是下载源代码自行编译,二是使用官方的软件仓库
PostgreSQL 现存很多版本,分别是7.3、7.4、8.0、8.1、8.2、8.3、8.4、9.0、9.1、9.2、 # yum localinstall http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-cen tos94-9.4-2.noarch.rpm 其中,pgdg-centos94-9.4-2.noarch.rpm是适用于CentOS 7-x86_64的软件包。同样地,也可以访问上一个链接来获取符合你使用的发行版的软件包。如果安装此软件后,会 # yum list postgresql* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * epel: ftp.cuhk.edu.hk * extras: mirrors.pubyun.com * ius: mirrors.tuna.tsinghua.edu.cn * remi-safe: mirrors.neterra.net * updates: mirrors.sina.cn Installed Packages postgresql-libs.x86_64 9.2.13-1.el7_1 @updates ******略去大量无用输出******** postgresql-upgrade.x86_64 9.2.13-1.el7_1 updates postgresql94-contrib.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-debuginfo.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-devel.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-docs.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-jdbc.noarch 9.3.1101-2.rhel7 pgdg94 postgresql94-jdbc-javadoc.noarch 9.3.1101-2.rhel7 pgdg94 postgresql94-odbc.x86_64 09.03.0400-1PGDG.rhel7 pgdg94 postgresql94-odbc-debuginfo.x86_64 09.03.0400-1PGDG.rhel7 pgdg94 postgresql94-plperl.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-plpython.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-pltcl.x86_64 9.4.5-1PGDG.rhel7 pgdg94 postgresql94-python.x86_64 4.1.1-2PGDG.rhel7 pgdg94 postgresql94-python-debuginfo.x86_64 4.1.1-2PGDG.rhel7 pgdg94 postgresql94-test.x86_64 可以看到,其实是CentOS默认源是包含了PostgreSQL9.2的。不过这个不重要,我们继续。 # yum install postgresql94-server 当然还可以根据需求安装其他的包,针对目前的练习,安装这个包就足够了。 安装完成后,需要初始化数据库。PostgreSQL对systemd支持并不完整,所以不能像在CentOS6.X中 # /usr/pgsql-9.4/bin/postgresql94-setup initdb Initializing database ... OK 此时系统初始化已经完毕,可以启动后台服务了: # systemctl list-unit-files |grep postgresql postgresql-9.4.service disabled # systemctl start postgresql-9.4 # systemctl enable postgresql-9.4 此刻,你的操作系统中就安装好了PostgreSQL,可以愉快地进行下一步实验了。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |