0x01
MySQL has been removed from version 5.5 and compiled by./configure and replaced by the CMake tool
Quote a sentence
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.
So first to install CMake can be installed by the source code can also use the already compiled RPM package to install
Yum installs Yum install cmake-y
Source installation Download Source wget--no-check-certificate https://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz
Decompression CMake TAR-ZXVF cmake-3.4.1.tar.gz
Compile the installation./configure--prefix=/usr/local/cmake make && make install
Make a soft link ln-s/usr/local/cmake/bin/cmake/usr/bin/cmake
Execute CMake--help Success!
0x02
Start installing the source MySQL
In the image of Sohu download source code
Wget-c http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.10.tar.gz
Unzip the source package
TAR-ZXVF mysql-5.7.10.tar.gz
Select the modules that need to be compiled according to your requirements
Create a directory of MySQL installation directory and data storage
Mkdir/usr/local/mysql----The directory of the installation files
Mkdir/mydata/mysql/log----Binary log directory, master from synchronous use
Mkdir/mydata/mysql/data----Database Data Catalog PS: Data directory must not be with the MySQL program installation directory to put together
Create MySQL users and groups
Groupadd-r-G 306 MySQL---Create a mysql group specifying GID for 306-r is created as a system user
Useradd-g mysql-u 306-r-s/sbin/nologin mysql---Create user mysql specify UID for 306 shell for non-logon shell system user attribution to MySQL Group
Start compiling the installation, but the error is as follows
You can download the corresponding package
Wget-c http://www.sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz
Unzip to the specified file and rename
TAR-ZXVF BOOST_1_59_0.TAR.GZ-C/tmp
Mv/tmp/boost_1_59/usr/local/boost
Compile and install
CMake. -dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/mydata/mysql/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-dwith_boost=/usr/local/boost
Do && make install installs successfully without error.
MySQL Learning-source installation (1)