Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ To install PostgreSQL 9.4     - Oracle 11g to create a second instance on Linux (Database)

- Java reflection summary (Programming)

- Python Socket Network Programming (Programming)

- Cobbler batch install Ubuntu / CentOS system (Linux)

- Ubuntu 14.04 LTS 64-bit install GNS3 1.3.7 (Linux)

- CentOS 5.11 Open VNC access (Linux)

- Nginx load balancing configuration (TCP proxy) (Server)

- How to create a new file system / partitions under Linux terminal (Linux)

- Java method to read and write files summary (Programming)

- CentOS 6 Install Linux kernel source (Linux)

- Use scripts easily install the latest Linux kernel in Ubuntu (Linux)

- Make command tutorial (Linux)

- Deploy Mono 4 and Jexus 5.6 on CentOS7 (Server)

- Java Virtual Machine Basics (Programming)

- Install the Red Hat Container Development Kit on OSX (Server)

- Create, modify, delete users, user groups under linux (Linux)

- Ubuntu 14.04 How to install Cinnamon 2.4.5 (Linux)

- Java factory pattern (Factory mode) (Programming)

- Linux installation notes under GAMIT (Linux)

- The Zabbix2.4.5 source compiler installation under Ubuntu 14.04 (Server)

 
         
  To install PostgreSQL 9.4
     
  Add Date : 2018-11-21      
         
         
         
  Linux installation PostgreSQL 9.4 process notes, we hope to be useful.

I. Introduction

PostgreSQL is also commonly referred to as Postgres, is a relational database management system for a variety of Linux operating systems, Windows, Solaris, BSD and Mac OS X. PostgreSQL is an open source software that is licensed under PostgreSQL. PostgreSQL was developed by the PostgreSQL Global Development Group, which is composed and managed by a handful of companies, including Red Hat, EnterpriseDB, and others.

PostgreSQL's popularity is growing, and it's justified: it's so reliable and efficient. Compared with the traditional enterprise-level relational database, PostgreSQL is completely based on community-driven, has a wealth of tools and documentation, forming a complete ecosystem.

Most of the current CentOS installation is used for Centos6.X part of the command has changed a lot, this article mainly records in the Linux Centos 7.1 to install PostgreSQL process.

Second, install the PostgreSQL source

CentOS 6.x 32bit

Rpm - Uvh http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-centos94-9.4-1.noarch.rpm

CentOS 6.x 64bit

Rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm

CentOS 7 64bit

Rpm -Uvh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm

      In the steps of adding the source and not too many differences, mainly the source address of a certain change.

Third, the implementation of the installation command

Yum update

Yum install postgresql94-server postgresql94-contrib

Fourth, verify whether the installation is successful

Rpm -aq | grep postgres

The results are as follows:

Postgresql94-libs-9.4.1-1PGDG.rhel7.x86_64
Postgresql94-server-9.4.1-1PGDG.rhel7.x86_64
Postgresql94-9.4.1-1PGDG.rhel7.x86_64
Postgresql94-contrib-9.4.1-1PGDG.rhel7.x86_64

Fifth, initialize the database

CentOS 6.x system

Service postgresql-9.4 initdb

CentOS 7 system

/usr/pgsql-9.4/bin/postgresql94-setup initdb

If I am in the implementation of service postgresql-CentOS 7 initdb will report the following questions

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

6, start the service and set to boot

CentOS 6.x system

Service postgresql-9.4 start
Chkconfig postgresql-9.4 on

CentOS 7 system

Systemctl enable postgresql-9.4
Systemctl start postgresql-9.4

7, open the firewall port

CentOS 6.x system

Vi / etc / sysconfig / iptables

Press I to enter the input mode, add some statements in the file

-A INPUT -m state --state NEW -m tcp -p tcp -dport 5432 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp -dport 80 -j ACCEPT

Press ESC to exit the edit mode after entering, and enter: wq to exit the VI editing interface.

Restart the firewall service

Service iptables restart

CentOS 7 system

Firewall-cmd --permanent --add-port = 5432 / tcp
Firewall-cmd --permanent --add-port = 80 / tcp
Firewall-cmd --reload

Visit PostgreSQL

Su - postgres

The output is as follows:

Last Login: 1 May 18 15:17:29 CST 2015pts / 0 on
-bash-4.2 $

Enter the command psql will see the version of PostgrSQL information.

Psql (9.4.1)
Enter "help" for help.

9. Set the postgres user password

Postgres = # password postgres
     
         
         
         
  More:      
 
- In-depth understanding of capture Node.js garbage collection and memory leaks (Programming)
- Setting the RedHat9 Intrusion Detection System (Linux)
- Linux System Getting Started Learning: compile and install ixgbe driver in Ubuntu or Debian (Linux)
- Workspace Go language and environment variables GOPATH (Linux)
- JavaScript function closures Quick Start (Programming)
- SQLite (Database)
- systemd run levels and service management command Introduction (Linux)
- Android Fragment everything you need to know (Programming)
- VMware virtual machine to install CentOS 6.2 (Linux)
- Linux garbled file delete method (Linux)
- Sublime Text 3 shortcuts summary (Linux)
- CentOS 6.6 install JDK7 (Linux)
- To install Ganglia (Linux)
- To record command input under Linux (Linux)
- Linux System Administrator Network Security Experience (Linux)
- After you change the GRUB boot disk partition repair (Linux)
- GNU Linux system variables (sysctl configuration commands) integrated use (Linux)
- SecureCRT use the configuration detailed tutorial (Linux)
- RedHat install GCC problem --- Depends (Linux)
- 20 Unix / Linux command skills (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.