Compile and install MySQL 5.0.67 in Linux

Source: Internet
Author: User

Author: youdi (Kevin. U)

For Daily maintenance convenience, we choose not to choose the rpm, but to use the tar.gz Method for installation.

We create a directory/data in the root file system to store Mysql Data:

# Mkdir data

Add mysql users and groups ,.

# Groupadd MySQL

# Useradd-G MySQL

Download the MySQL package:

# Cd/Data

# Wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz/from/http://mysql.ntu.edu.tw/

# Tar zxvf mysql-5.0.67.tar.gz/

# Music mysql-5.0.67 mysql5src

Compile the compiled shell script makeit. Sh with the following code:

#! /Bin/sh
Cflags = "-O2-mcpu = pentiumpro" cxx = GCC cxxflags = "-O2-mcpu = pentiumpro-felide-constructors ". /configure -- prefix =/data/mysql5 -- With-charset = GBK -- With-extra-charsets = gb2312, big5 -- enable-thread-safe-client -- enable-local-infile -- enable-Handler -- With-client-ldflags =-all-static -- With-mysqld-ldflags =-all- static -- without-Debug -- without-InnoDB
Make

Make install

From the makeit. Sh script above, we can see that the MySQL installation path is/data/mysql5.

Run/data/mysql5src/scripts/mysql_install_db to install the MySQL system table.

To facilitate routine data maintenance:

CD/data/mysql5

Ln-s var/data/var

Chown-r MYSQL: MySQL VaR

CD/data/

Chown-r MYSQL: MySQL mysql5

CP/Data/mysql5/share/MySQL. Server/etc/rc. d/init. d

Chkconfig -- add mysql. Server

Add to system Lib:

VI/etc/lD. So. conf

Add:/data/mysql5/lib/MySQL

Ldconfig



Various software package dependencies may occur during compilation:

The most typical is

Ncurses:

Ftp://mirror.switch.ch/mirror/fedora/linux/core/5/i386/ OS /Fedora/RPMS/ncurses-devel-5.5-19.i386.

Ftp://mirror.switch.ch/mirror/fedora/linux/core/5/i386/ OS /Fedora/RPMS/ncurses-5.5-19.i386.rpm

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.