Install PostgreSQL9.3 on CentOS

Source: Internet
Author: User

Linux: CentOS

1. log on to the system as the root user, download postgresql9.3, decompress the package, and enter the decompressed postgresql directory.
 
2. Compile and install
# Pwd
#./Configure -- profix =/usr/local/pgsql
(An error may occur. Install dependent packages such as gcc, readline, readline-devel, and zlib and install them using yum)
# Make
# Make install
 
3. Create users and groups
# Groupadd S
# Useradd-g postgres
 
4. Environment Settings
# Mkdir/usr/local/pgsql/data
# Chown postgres: postgres-R/usr/local/pgsql/data
# Su-postgres
$ Vim. bash_profile
Add:
PGHOME =/usr/local/pgsql
PGDATA = $ PGHOME/data
PATH = $ PATH: $ HOME/bin: $ PGHOME/bin
Export PGHOME
Export PGDATA
Export PATH
$ Source. bash_profile
 
5. initialize the database
$ Initdb-D $ PGDATA
 
6. system service configuration and Automatic startup
# Postgresql-9.3.1/cd/root
# Cp contrib/start-scripts/linux/etc/init. d/postgresql
# Chmod + x/etc/init. d/postgresql
# Service postgresql status -- (start | stop)
 
# Chkconfig -- add postgresql
# Chkconfig postgresql on
 
7. Configure the listening address and port
$ Vim $ PGDATA/postgresql. conf
$ Vim $ PGDATA/pg_hba.conf

PostgreSQL cache details

Compiling PostgreSQL on Windows

Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu

Install and configure phppgAdmin on Ubuntu

PostgreSQL details: click here
PostgreSQL: click here

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.