CentOS Installation PostgreSQL 9.4

Source: Internet
Author: User
Tags iptables

1. Installing the PostgreSQL source

# yum Install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm

There is not much difference in the step of adding the source, mainly the source address has a certain change

Execute the Install command

# yum Install Postgresql94-server Postgresql94-contrib

Verify that the installation is successful

# rpm-aq| grep postgres

Execution results are as follows

Postgresql94-libs-9.4.1-1pgdg.rhel7.x86_64postgresql94-server-9.4.1-1pgdg.rhel7.x86_ 64postgresql94-9.4.1-1pgdg.rhel7.x86_64postgresql94-contrib-9.4.1-1pgdg.rhel7.x86_64

2. Initializing the database

# service postgresql-9.4 Initdb

3. Start the service and set it to boot

# service postgresql-9.4 Start
# chkconfig postgresql-9.4--level

4. Open firewall port

Vi/etc/sysconfig/iptables

Press I to enter input mode and add a statement to 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 edit mode and enter: Wq to exit the VI editing interface.

Restart Firewall service

# Service Iptables Restart

5. Accessing PostgreSQL

# Su-postgres

-bash-4.2$

-bash-4.2$ Psql

postgres=#

Set Postgres user Password

postgres=# \password Postgres

Password with default Postgres

CentOS Installation PostgreSQL 9.4

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.