Record how to install and deploy PostgreSQL in CentOS

Source: Internet
Author: User
Tags postgresql centos postgresql version

MySQL License charges become more and more realistic. PostgreSQL has become the best alternative.

Deployment environment: CentOS6.3 x64.
PostgreSQL version: 9.2.4-1.

The CentOS Develop package Mode line may already have a PostgreSQL database, but the version is old. Here we need to deploy a new one.
The official website provides many deployment methods. Here I chose the offline installation package for command line interaction, because it can be installed without the network and operating system UI, which is close to the production environment.

Offline package download address: http://community.openscg.com/se/postgresql/packages.jsp

Download the corresponding OS package, grant the execution permission, and execute the package to complete the installation. During installation, some default storage directories will be set interactively. If there are no special requirements, press enter by default.

The installation can be completed quickly.

START database
It cannot be started by the root user. You need to use the new user created during installation. The default value is postgres.

Bin> S-D data

-D: specifies the configuration file and data storage directory. This directory must exist and contain the S. conf configuration file. After installation in the preceding method, you only need to specify the data folder under the installation directory.
If the directory does not exist, initialize the directory.

> Initdb-D Directory

If you need to remotely access the database, you need to modify the pg_cmd.conf file to grant the access permission to the specified host and ip address. In fact, the configuration in postgresql. conf affects access, but permissions are enabled by default.

After startup, you can use

> Psql

Connect the client to the database to view the database information. You can use help to view specific commands.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.