One, download the installation of the necessary dependency package
1, because the high version of MySQL is installed with cmake, so download cmake
wget http://www.cmake.org/files/v3.0/cmake-3.0.1.tar.gz
Tar zxvf cmake-3.0.1.tar.gz
CD cmake-3.0.1
./configure
Make && make install
2. Download other Packages
wget http://ftp.gnu.org/gnu/bison/bison-3.0.2.tar.gz
Installation Ibid.
wget ftp://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz
Installation Ibid.
Ii. Creating catalogs and users
1. Set up MySQL installation directory and data storage directory
Mkdir/usr/local/mysql
Mkdir/usr/local/mysql/data
2. Set up users and user groups
Groupadd MySQL
useradd-g MySQL mysql-s/sbin/nologin
3. Give directory Permissions
Chown Mysql:mysql-r/usr/local/mysql/
Third, compile and install
1. Compile MySQL with CMake
Tar zxvf mysql-5.6.20.tar.gz
CD mysql-5.6.20
Cmake-dcmake_install_prefix=/usr/local/mysql
Make && make install
2. Initialize the database
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
3. Edit the/USR/LOCAL/MYSQL/MY.CNF configuration file
[Mysqld]
Basedir =/usr/local/mysql
DataDir =/usr/local/mysql/data
Log-error =/usr/local/mysql/mysql_error.log
Pid-file =/usr/local/mysql/mysql.pid
user = MySQL
Tmpdir =/tmp
If this configuration file is not present, then the CP support-files/my-medium.cnf/usr/local/mysql/my.cnf one.