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: