MySQL Compiling and Installation

Source: Internet
Author: User

Compiling and installing MySQL-5.5


One of the important characteristics of CMake is its independent of the source code (OUT-OF-SOURCE) of the compilation function, that is, the compilation work can be in another specified directory rather than the source directory, which can ensure that the source directory is not affected by any one compilation, so in the same source tree can be many different compilations, such as for different platforms to compile.


Compiling and installing MySQL-5.5



First, install the CMake


Cross-platform compilers


# Tar XF cmake-2.8.8.tar.gz

# CD cmake-2.8.8

#./bootstrap

# make

# make Install




Second, compile and install mysql-5.5.25a


1. Compile mysql-5.5 with CMake

CMAKE specifies compilation options in a different way from make, which is implemented in the following way:

./configure CMake.

./configure--help CMake. -lh or Ccmake.




Specifies the options that are commonly used when installing the installation path of a file:

-dcmake_install_prefix=/usr/local/mysql

-dmysql_datadir=/data/mysql

-dsysconfdir=/etc



The storage engines that are compiled by default include: CSV, MyISAM, MYISAMMRG, and heap. To install additional storage engines, you can use a compilation option similar to the following:

-dwith_innobase_storage_engine=1

-dwith_archive_storage_engine=1

-dwith_blackhole_storage_engine=1

-dwith_federated_storage_engine=1


To explicitly specify that a storage engine is not compiled, you can use an option similar to the following:

-dwithout_<engine>_storage_engine=1

Like what:

-dwithout_example_storage_engine=1

-dwithout_federated_storage_engine=1

-dwithout_partition_storage_engine=1


If you want to compile into other functions, such as SSL, you can use a library similar to the following, or do not use a library when compiling:

-dwith_readline=1

-dwith_ssl=system

-dwith_zlib=system

-dwith_libwrap=0


Other common options:

-dmysql_tcp_port=3306

-dmysql_unix_addr=/tmp/mysql.sock

-denabled_local_infile=1

-dextra_charsets=all

-ddefault_charset=utf8

-ddefault_collation=utf8_general_ci

-dwith_debug=0

-denable_profiling=1




If you want to clean up the files generated by the previous compilation, you need to use the following command:

Make clean

RM CMakeCache.txt



2. Compile and install


# groupadd-r MySQL

# useradd-g Mysql-r-d/data/mydata MySQL

# Tar XF mysql-5.5.25a.tar.gz

# CD MYSQL-5.5.25A

# CMake. -dcmake_install_prefix=/usr/local/mysql \

-dmysql_datadir=/mydata/data \

-DSYSCONFDIR=/ETC \

-dwith_innobase_storage_engine=1 \

-dwith_archive_storage_engine=1 \

-dwith_blackhole_storage_engine=1 \

-dwith_readline=1 \

-dwith_ssl=system \

-dwith_zlib=system \

-dwith_libwrap=0 \

-dmysql_unix_addr=/tmp/mysql.sock \

-ddefault_charset=utf8 \

-ddefault_collation=utf8_general_ci

# make

# make Install


This article is from the "lake and Laughter" blog, please make sure to keep this source http://hashlinux.blog.51cto.com/9647696/1760694

MySQL Compiling and Installation

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.