1、Install the repository RPM:@H_404_3@
yum install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm@H_404_3@
2、Install the client packages:@H_404_3@
yum install postgresql95
@H_404_3@
3、Optionally install the server packages:@H_404_3@
yum install postgresql95-server@H_404_3@
4、Optionally initialize the database and enable automatic start:@H_404_3@
/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl enable postgresql-9.5
systemctl start postgresql-9.5@H_404_3@
5、Test:@H_404_3@
su - postgres@H_404_3@
$\l@H_404_3@
CREATE DATABASE myDb;
@H_404_3@
CREATE USER mytest CREATEDB LOGIN PASSWORD 'mytest';
@H_404_3@
GRANT ALL ON DATABASE myDb TO mytest; @H_404_3@ 原文链接:https://www.f2er.com/bash/389491.html