Centos 6.3 minimal Yum install PostgreSQL 9.2.3

Source: Internet
Author: User
Tags unix domain socket

Environment: centos 6.3 minimizes the default installation and configures the NIC.

Before installing PostgreSQL, check that the Internet connection is normal to download the installation file.

Use the Yum-y update command to upgrade the system to the latest version.

# Modify firewall settings and open port 5432

VI/etc/sysconfig/iptables
-A input-M state -- state new-m tcp-p tcp -- dport 5432-J accept

# Restart the firewall to make the new settings take effect
Service iptables restart

# Visit the http://yum.pgrpms.org/repopackages.php page to find the URL of the latest PostgreSQL Yum configuration.

# Select the desired RPM based on the version and run the following command:
Rpm-uvh http://yum.pgrpms.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm

# Modifying the original Yum repository Configuration
VI/etc/yum. Repos. d/CentOS-Base.repo
Append exclude = PostgreSQL * at the end of the [base] and [updates] sections to cancel the installation and update of postgresql from the default repository.

# Installing PostgreSQL
Yum-y install postgresql-Server

# Execute the database Initialization Script
Service postgresql-9.2 initdb

# Start the service
Service postgresql-9.2 start

# Change logon user
Su-Postgres

# Log on to the database and modify the Postgres user's Database Password
Psql
S = # alter user Postgres password '123 ';
Postgres = # \ q

# Exit change Logon
Exit

# Edit the configuration file to configure the network address for database access
(Do not forget to remove # listen_addresses = previous #)
VI/var/lib/pgsql/9.2/data/PostgreSQL. conf
Listen_addresses = '*'

# Edit the configuration file and set the password for MD5 Verification
VI/var/lib/pgsql/9.2/data/pg_assist.conf
# "Local" is for Unix domain socket connections only
Local all MD5
# IPv4 local connections:
# Host all 127.0.0.1/32 ident
Host All all 0.0.0.0/0 MD5

# Restart the Database Service
Service postgresql-9.2 restart

# Set automatic start of service upon startup
Chkconfig postgresql-9.2 on

 

 

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.