Linux database comparison (1)

Source: Internet
Author: User
Tags mysql download unpack install perl
Author: Matthias warkus
Author: Matthias warkus
Yanzi clyan@sohu.com <mailto: clyan@sohu.com>

Introduction
When someone suggested that I write a database management system comparison for linuxplanet for the first time, I shook my head,
I have never done such a comparison, but later I thought: why? Maybe a fresh and naive Method
Not bad. So there is this article: a new look at the colorful Linux database world. This article consists of four parts.

The database managers compared here are free or have a cheap license fee, and they can be at all levels
From low-end hardware to high-end multi-processor servers, they have been widely used in the world.
Production system. For comparison, I put myself in the context of running a typical Linux machine
Every day, DBMS provides power.

I will examine:

Msql
MySQL
PostgreSQL
I will start with a discussion of the installation and configuration of these three database systems, and then I will follow the steps described in section 2nd
Continued. Through the design of a small SQL database, I pointed out the difficulties I encountered and tried to connect the Database System
I will also explain the difference Program It performs various real operations on the database, such
Add data and generate reports, and discuss the differences in database processing. This customer program targets
Three database systems are implemented in C language. For this reason, I must not only learn all system SQL APIs, but also
SQL. If there is nothing else, it will certainly be interesting.

The third part will include some real benchmarking as a reward. I already have a Linux newsgroup
Watch the endless arguments about the benchmark test results of the database, so I will only
Test the time performance of the client program to perform random tasks. It runs in ideal conditions and sends multiple tasks
. At that time, I will have covered most of the differences between DBMS, so you should have something about them
A good concept of strengths and weaknesses.

The last part is what you expect: Conclusions, covered features, implementations, Apis between DBMS
And performance differences.

But now, let's explore the database management realm.

Obtain and install PostgreSQL
The software section on the PostgreSQL website has a list of FTP and HTTP image websites available from
Download and distribution. You can also select to order dbms cd. Constructing and installing it is a multi-step process.

First, if you want to establish a PostgreSQL Perl language binding, you can run the Perl 5 command on your system.
The row file must be named perl5. Normally, this means you need to make a symbolic connection.

Perhaps the most important thing to do is to create an ipvs user. On my system, this command can be
Run:
Useradd-C "PostgreSQL administrator"-D/opt/postgresql-G users
Postgres
On other systems, commands may be different. Note: I assume that ipvs is in the Users Group. You can
You prefer to give the database supervisor a group of its own.

Unless otherwise specified, all other installation steps must be performed as Postgres.
Unbind the PostgreSQL package and enter Source code Directory tree:

Tar-xvzf postgresql-6.5.2.tar.gz
CD postgresql-6.5.2

Use the root user to create the PostgreSQL directory and hand it over to the Postgres User:
Mkdir/opt/pgsql
Chown Postgres. Users/opt/pgsql

Go to source Code Directory and configure the software package. Use the following options:

./Configure -- prefix =/opt/pgsql -- With-perl
Construction and installation process:
CD ../doc
Make install
CD ../src
Make all
Make install

Now it is time to execute some additional system configurations.

As root
/Opt/pgsql/lib
Add/etc/lD. So. conf and run ldconfig.

Install Perl binding. After you log on to the server as the root user:
CD interface/perl5
Make install

Set the s account. Add the following lines to the. profile file:
Path = $ path:/opt/pgsql/bin
Manpath = $ manpath:/opt/pgsql/man
Pglib =/opt/pgsql/lib
Pgdata =/opt/pgsql/Data
Export path manpath pglib pgdata
Lc_collate = C
Lc_ctype = C
Export lc_collate lc_ctype

The last three lines are necessary for the INIT process and some tests. For actual users, of course they should
Set to the appropriate site, but each person using PostgreSQL must have at least pglib and pgdata settings
.

Source. profile file:
Source. Profile
Post-installation:
Initdb
Obtain and install MySQL
The latest MySQL version can be downloaded from the MySQL download page. There are many available image sites. You need to execute the following
Steps:

Unpack the package and enter the source code directory tree:
Tar-xvzf mysql-3.22.26a.tar.gz
CD mysql-3.22.26a

Configure the software package. I use the following items:
./Configure -- prefix =/opt/MySQL
Construct it:
Make
Install it. Use the root user:
Make install
Then you need to configure and install:

As the root user, create an authorized database table:
Scripts/mysql_install_db
As root, start the server:
/Opt/MySQL/bin/safe_mysqld &

Create a MySQL user as root:
Useradd-C "MySQL administrator"-D/opt/MySQL-G users MySQL
As the root user, assign the installation tree owner to the MySQL user:
Chown-r mysql. Users/opt/MySQL

Obtain and install msql
Downloading msql is not as simple as downloading PostgreSQL or MySQL, but its distribution is smaller. From Hughes
The technical web page starts and looks for further instructions. To download msql, you must first register and
A cgi-based download system allows you to select images from different sites if necessary. Constructor and
To install msql, follow these steps:

Unpack the package and go to the source code directory:
Tar-xvzf msql-2.0.11.tar.gz
CD msql-2.0.11

Target definition:
Make target
Go to the target directory of your platform:
CD targets/Linux-2.2.12-i586
Configuration package:
./Setup
Edit site. Mm. I will change the installation path to/opt/msql.
Construct it:
Make all
Install it as a root user:
Make install
After constructing and installing msql, You need to configure it:

Create an msql user as root:
Useradd-C "msql administrator"-D/opt/msql-G users msql
As the root user, assign the directory owner to the msql User:
Chown-r msql. Users/opt/msql

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.