How to install PostgreSQL11 on CentOS7

How to install PostgreSQL11 on CentOS7

Install PostgreSQL 11 on CentOS 7

PostgreSQL: The World's Most Advanced Open Source Relational Database

In order to learn about the world's most advanced open source relational database, you must first install it. Next, install PostgreSQL 11 on CentOS 7.

environment

Alibaba Cloud CentOS 7.3.1611

PostgreSQL 11

PostgreSQL

PostgreSQL is an object-relational database management system (ORDBMS) based on POSTGRES, which was developed by the Department of Computer Science at the University of California, Berkeley and has now been renamed PostgreSQL, version 4.2. PostgreSQL supports most of the SQL standard and provides many other modern features: complex queries, foreign keys, triggers, views, transactional integrity, MVCC. Likewise, PostgreSQL can be extended in many ways, for example, by adding new data types, functions, operators, aggregate functions, and indexes. PostgreSQL is free to use, modify, and distribute for private, commercial, and academic research purposes.

PostgreSQL has had a built-in JSON data type since version 9.3, and JSONB support since version 9.4, indicating that PostgreSQL is actually a combination of a relational database and a NoSQL database. Although PostgreSQL is still positioned as a relational database, in recent updates, PostgreSQL's NoSQL performance has soared and even surpassed MongoDB.

PostgreSQL Installation

Here we install PostgreSQL 11 in rpm mode

# Download rpm package yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm -y

# Install yum -y install postgresql11 postgresql11-server postgresql11-libs

# Initialize the database /usr/pgsql-11/bin/postgresql-11-setup initdb

# Set PostgreSQL to start automatically at boot and start the service systemctl enable postgresql-11
systemctl start postgresql-11
systemctl status postgresql-11
## If you see the word "Running" after "Active" in the console output, it means the startup is complete.

PostgreSQL Connection

# Log in to the database, switch account postgres here
su - postgres
psql

# Navicat connects to PostgreSQL
# Here we need to modify the configuration file postgresql.conf
find / -name postgresql.conf
vi /var/lib/pgsql/11/data/postgresql.conf

# Find listen_address, uncomment it and change the value of localhost in quotes to *
listen_address="*"

# Save and exit, restart the postgresql service systemctl restart postgresql-11

# Alibaba Cloud Security Group Rule Configuration -> Quickly Add Security Group Rules -> Select PostgreSQL and add # In Navicat, if you do not change localhost to *, Navicat will prompt an error "Connection Refuse" when connecting.

# I changed the password of the postgres user here, the steps are as follows:
## Switch user and enter psql
su - postgres
psql
## Change password alter user postgres password 'password' 

Connection successful!

At this point, PostgreSQL is set up. Setting up PostgreSQL on Windows is relatively simple. Next, learn PostgreSQL!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to get the current date and time in PostgreSQL and precautions
  • PostgreSQL tree structure recursive query example
  • Syntax and usage of window functions in PostgreSQL database
  • How to implement batch insert, update and merge operations in PostgreSQL
  • PostgreSQL stored procedure usage practical explanation
  • Example code for resetting PostgreSQL password on Mac

<<:  jQuery plugin to implement minesweeper game (1)

>>:  MySQL uninstall and install graphic tutorial under Linux

Recommend

How to create a stored procedure in MySQL and add records in a loop

This article uses an example to describe how to c...

Detailed explanation of the functions and usage of MySQL common storage engines

This article uses examples to illustrate the func...

How to change the color of the entire row (tr) when the mouse stops in HTML

Use pure CSS to change the background color of a ...

MySQL statement arrangement and summary introduction

SQL (Structured Query Language) statement, that i...

How can MySQL effectively prevent database deletion and running away?

Table of contents Safe Mode Settings test 1. Upda...

Native JS to implement image carousel JS to implement small advertising plug-in

Recently I want to use native JS to implement som...

Solve the scroll-view line break problem of WeChat applet

Today, when I was writing a small program, I used...

English: A link tag will automatically complete href in IE

English: A link tag will automatically complete h...

Complete steps to configure a static IP address for a Linux virtual machine

Preface In many cases, we will use virtual machin...

Vue project realizes login and registration effect

This article example shares the specific code of ...

Detailed explanation of BOM and DOM in JavaScript

Table of contents BOM (Browser Object Model) 1. W...

Detailed explanation of VUE's data proxy and events

Table of contents Review of Object.defineProperty...

How to clean up the disk space occupied by Docker

Docker takes up a lot of space. Whenever we run c...

Two simple menu navigation bar examples

Menu bar example 1: Copy code The code is as foll...