First, yum installation Pgsql10
Two
First, yum installation Pgsql10
- Install Pgsql First
Environment CentOS 7 64-bit
Database: Pg10dev
Reference URL:
http://blog.csdn.net/silenceray/article/details/70577610
Create user
[[Email protected] ~] #useradd postgres
Configure your Yum repository
[Email protected] ~]# Vim/etc/yum.repos.d/centos-base.repo
add between [base] and [Updates] sections:
exclude=postgresql*
Installing the RPM file for PG
[email protected] ~]# Yum Localinstall https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7-x86_ 64/pgdg-centos10-10-1.noarch.rpm
Installing the PG Database
[email protected] ~]# Yum list postgresql*
[email protected] ~]# Yum install postgresql10-server.x86_64
[Email protected] ~]# mkdir postgres/var/lib/pgsql/10/data
Initializing the database
[Email protected] ~]#/usr/pgsql-10/bin/postgresql10-setup initdb
Initializing database ... Ok
[Email protected] ~]# Su-postgres
[Email protected] ~]$/usr/pgsql-10/bin/pg_ctl-d/var/lib/pgsql/10/data start
[Email protected] ~]$/usr/pgsql-10/bin/psql-p 5432
Psql (10devel)
Enter "Help" for information.
postgres=#
Installation is complete!
- Configure Pgsql to enable clients to access
2.1 Change Password
(1) Su Postgres
(2) Psql-u postgres-p5433
(3) Alter user postgres with password ' postgres ';
2.2 Modify the configuration file to allow remote login.
and pg_hba.conf a directory of, Postgresql.conf,
listen_addresses = ‘localhost‘ ,改成listen_addresses = ‘*‘
2.3 Modifying ports
Test the PostgreSQL cluster