安装postgresql94
客户端:postgresql94-9.4.17-1PGDG.rhel6.x86_64.rpm
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
安装命令
安装包
[root@yun01 postgresql94_17]# ll |awk -F ' ' '{print $9;}'
postgresql94-9.4.17-1PGDG.rhel6.x86_64.rpm
postgresql94-contrib-9.4.17-1PGDG.rhel6.x86_64.rpm
postgresql94-libs-9.4.17-1PGDG.rhel6.x86_64.rpm
postgresql94-server-9.4.17-1PGDG.rhel6.x86_64.rpm
执行安装命令没有报错就可以了
[root@yun01 lib]# rpm -qa|grep postgres
postgresql-libs-8.4.20-6.el6.x86_64
postgresql-devel-8.4.20-6.el6.x86_64
postgresql-8.4.20-6.el6.x86_64
[root@yun01 lib]#
[root@yun01 lib]# rpm -ivh postgresql94-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-libs-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-server-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-contrib-9.4.17-1PGDG.rhel6.x86_64.rpm
error: open of postgresql94-9.4.17-1PGDG.rhel6.x86_64.rpm failed: No such file or directory
error: open of postgresql94-libs-9.4.17-1PGDG.rhel6.x86_64.rpm failed: No such file or directory
error: open of postgresql94-server-9.4.17-1PGDG.rhel6.x86_64.rpm failed: No such file or directory
error: open of postgresql94-contrib-9.4.17-1PGDG.rhel6.x86_64.rpm failed: No such file or directory
[root@yun01 lib]# cd /root/postgresql94_17/
[root@yun01 postgresql94_17]# rpm -ivh postgresql94-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-libs-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-server-9.4.17-1PGDG.rhel6.x86_64.rpm postgresql94-contrib-9.4.17-1PGDG.rhel6.x86_64.rpm
Preparing... ########################################### [100%]
1:postgresql94-libs ########################################### [ 25%]
2:postgresql94 ########################################### [ 50%]
3:postgresql94-server ########################################### [ 75%]
4:postgresql94-contrib ########################################### [100%]
[root@yun01 postgresql94_17]#
[root@yun01 postgresql94_17]#
[root@yun01 postgresql94_17]# service postgresql-9.4 status
postgresql-9.4 is stopped
[root@yun01 postgresql94_17]# service postgresql-9.4 start
/var/lib/pgsql/9.4/data is missing. Use "service postgresql-9.4 initdb" to initialize the cluster first.
[FAILED]
[root@yun01 postgresql94_17]# service postgresql-9.4 initdb
Initializing database: [ OK ]
[root@yun01 postgresql94_17]# service postgresql-9.4 status
postgresql-9.4 is stopped
[root@yun01 postgresql94_17]# service postgresql-9.4 start
Starting postgresql-9.4 service: [ OK ]
[root@yun01 postgresql94_17]# service postgresql-9.4 status
postgresql-9.4 (pid 6162) is running...
[root@yun01 postgresql94_17]#
[root@yun01 postgresql94_17]# su - postgres
-bash-4.1$ psql
psql (8.4.20, server 9.4.17)
WARNING: psql version 8.4, server version 9.4.
Some psql features might not work.
Type "help" for help.
postgres=# \q
-bash-4.1$ logout
[root@yun01 postgresql94_17]# chkconfig --list |grep posgres
[root@yun01 postgresql94_17]# chkconfig --list |grep postgres
postgresql-9.4 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@yun01 postgresql94_17]# chkconfig postgresql-9.4 on
[root@yun01 postgresql94_17]# chkconfig --list |grep postgres
postgresql-9.4 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@yun01 postgresql94_17]#