First, compile and install MySQL before the preparatory work
Install the tools and libraries needed to compile the source code
Yum install gcc gcc-c++ ncurses-devel perl
Install CMake, download the source code from http://www.cmake.org and compile the installation
wget http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz
TAR-XZVF cmake-2.8.10.2.tar.gz
CD cmake-2.8.10.2
./bootstrap; make; Make install
CD ~
Second, set up MySQL users and groups
New MySQL user group
Groupadd MySQL
New MySQL User
A. useradd-r-G MySQL MySQL
Iii. directories required for new MySQL
new MySQL installation project Record
A. mkdir-p/usr/local/mysql
New MySQL database data file directory
A. Mkdir-p/data/mysqldb
Download the MySQL source package and unzip it.
Download Mysql:http://pan.baidu.com/s/1jgngvee
V. Compile and install MySQL
From mysql5.5 onwards, MySQL source installation started using CMake, set the source code compilation configuration script.
CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_unix_addr=/usr/local/mysql/mysql.sock \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_innobase_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dmysql_datadir=/mnt/soft/mysql/mysql_install_db_store \
-dmysql_tcp_port=3306 \
-denable_downloads=1
Special Note: The preceding spaces are required
Note: To rerun the configuration, you need to delete the CMakeCache.txt file
RM CMakeCache.txt
Compiling source code
Make
Installation
Make install
Vi. modifying MySQL directory Owners and Groups
Modify the owner of the MySQL installation directory
Cd/usr/local/mysql
Chown-r Mysql:mysql.
Modifying the MySQL database file directory
Cd/data/mysqldb
Chown-r Mysql:mysql.
Vii. initializing MySQL Database
VIII. copy MySQL service startup configuration file
Cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf
Note: Overwrite if the/etc/my.cnf file exists.
IX. copy MySQL service startup script and join path path
Linux CentOS6.5 under source code compilation install MySQL 5.6.16 "give the Force detailed tutorial"