CentOS Installation Pgsql
Yum installs PostgreSQL under CentOS
Directory
1 Configure YUM Repository
2 Install pgdg RPM file
3 Install PostgreSQL
4 configuration
5 Initialize
6 Startup
Specific steps:
1.
Vim/etc/yum.repos.d/centos-base.repo
[Base] and [Updates] sections added:
exclude=postgresql*
2.Install PGDG RPM File
http://yum.postgresql.org website Find the download version of the rpm download path, do the following:
Yum Localinstall http://yum.postgresql.org/9.5/redhat/rhel-6-x86_64/pgdg-centos95-9.5-2.noarch.rpm
3. Install PostgreSQL
3.1 List Available Packages:
Yum List postgres*
3.2 For example, to install a basic PostgreSQL 9.5 server:
Yum Install Postgresql95-server
3.3 Other packages can is installed according to your needs.
4. Configuration
After installing the packages, a database needs to be initialized and configured.
PostgreSQL Data Directory (/var/lib/pgsql/9.5/data) contains all of the data files for the database.
5. Initialize
5.1 The first command (only needed once) was to initialize the database:
Service postgresql-9.5 Initdb
Initializing database: [OK]
6. Startuph
Set boot up:
Chkconfig--level 2345 postgresql-9.5 on
Service postgresql-9.5 Start
CentOS Installation Pgsql