Here I have selected the version of mysql-5.5.33-linux2.6-x86_64.tar.gz. You can select it based on your actual needs.
1. MYSQLhttp: // mirrors.sohu.com/mysql/
2. Download the source package wget http://mirrors.sohu.com/mysql/MySQL-5.5/mysql-5.5.33-linux2.6-x86_64.tar.gz
3. MySQL 5.5x and later versions all adopt the CMAKE installation method. You need to install the CMAKE tool first.
# Wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
# Tar zxvf cmake-2.8.4.tar.gz
# Cd cmake-2.8.4
#./Configure
# Make
# Make install
3. decompress the source package and enter the directory.
Tar xzvf mysql-5.5.33-linux2.6-x86_64.tar.gz
Cd mysql-5.5.33-linux2.6-x86_64
4. Check whether the compiling environment is available
Yum-y install gcc * gcc-c ++ * autoconf * automake * zlib * libxml * ncurses-devel * libgcrypt * libtool *
5. Create the mysql installation directory and Data Directory
Installation Directory mkdir/data/mysql
Data storage mkdir/data/mysql/data
6. Create users and user groups and grant data storage directory permissions
Groupadd mysql
Useradd-g mysql
Chown mysql. mysql-R/data/mysql/
7. Compile and install and configure compilation Parameters
Cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_DATADIR =/usr/local/mysql/data \
-DMYSQL_TCP_PORT = 3306 \
-DMYSQL_UNIX_ADDR =/usr/local/mysql/data/mysqld. sock \
-DMYSQL_USER = mysql \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DEXTRA_CHARSETS = all \
-DWITH_READLINE = 1 \
-DWITH_EMBEDDED_SERVER = 1 \
-DENABLED_LOCAL_INFILE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1
Make & make install
Install Apache2.4 + PHP5.4 + MySQL5.5 in the source code of CentOS
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5