Compile and install the PostgreSQL 6.5 database on CentOS 9.3

Source: Internet
Author: User
Tags ibm db2 psql

Compile and install the PostgreSQL 6.5 database on CentOS 9.3

Preface
PostgreSQL is a free object-relational database server (Database Management System), which is issued under a flexible BSD-style license. It provides an alternative to other open-source database systems (such as MySQL and Firebird) and proprietary systems (such as Oracle, Sybase, IBM DB2, and Microsoft SQL Server.
Next, let's take a look at how to compile and install the PostgreSQL 6.5 database on the CentOS 9.3 system. This was also raised by a group member after reading the previous article about installing the oracle database. I am confused to do my best.

Preparations before compilation and Installation
Yum install gcc-c ++ make readline-devel flex zlib-devel-y
Click here to download the desired version and put it in the directory that you can easily manage. I will use PostgreSQL 9.3.3 as an example.

# Decompress
Tar zxvf postgresql-9.3.3.tar.gz
 
# Enter the extracted directory
Cd postgresql-9.3.3
 
# -- Prefix indicates which directory to install
./Configure -- prefix =/usr/local/pgsql
 
# Compile and install
Make & make install
After installation, configure

# Add a user
Useradd S
 
# Creating a data directory
Mkdir-p/data/pgsql_data
 
# Granting permissions
Chown postgres: postgres/data/pgsql_data
 
# Switch to postgres user
Su-postgres
 
# Enter the bin directory
Cd/usr/local/pgsql/bin
 
# Initializing a database
./Initdb-D/data/pgsql_data
 
# Exit the ipvs user
Exit
 
# Here, the database is installed.
However, there is still a lack of STARTUP script. Fortunately, postgresql has already prepared it for you, so where is it? Use it in your source code directory.

# Copy the linux Startup Script in the postgresql source package directory to/etc/init. d.
Cp your source code directory/contrib/start-scripts/linux/etc/init. d/pgsqld
 
# Grant execution permission
Chmod 755/etc/init. d/pgsqld
 
# Starting a database
Service pgsqld start
 
# Start startup
Chkconfig pgsqld on
The other thing is not completed, that is, the newly installed postgresql database does not have a password. You have to set a password for it.

# Connect to the database and change the Administrator Password
/Usr/local/psql/bin/psql-U postgres
 
# Execute the following statement to set a password for postgres users
Alter user Login s with password 'your password ';
 
# Exit
\ Q

Well, this is the process of compiling and installing the postgresql database. If you have any questions or problems, please leave a message.

------------------------------------ Lili split line ------------------------------------

Install PostgreSQL 6.3 on yum in CentOS 9.3

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

Install PostgreSQL9.3 on CentOS

Configure a Streaming Replication cluster in PostgreSQL

------------------------------------ Lili split line ------------------------------------

PostgreSQL details: click here
PostgreSQL: click here

This article permanently updates the link address:

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.