1. Download mysql5.6.20
wget http://dldx.csdn.net/fd.php?i=647578207794786&s=4f3a5759b24d9da51def820682899e00
2. Install the required components
yum-y install gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-de vel* make CMake
3. Create a MySQL user
Groupadd MySQL
Useradd-r-G MySQL MySQL
4. Compiling MySQL
Create a Data Save folder Mkdir/data
Tar zxvf mysql-5.6.20.tar.gz
CD mysql-5.6.20
Cmake-dcmake_install_prefix=/usr/local/mysql-dmysql_datadir=/data-dsysconfdir=/etc-dwith_myisam_storage_engine =1-dwith_innobase_storage_engine=1-dwith_memory_storage_engine=1-dwith_readline=1-dmysql_unix_addr=/var/lib/ Mysql/mysql.sock-dmysql_tcp_port=3306-denabled_local_infile=1-dwith_partition_storage_engine=1-dextra_charsets =all-ddefault_charset=utf8-ddefault_collation=utf8_general_ci
Make&make Install
Chown-r Mysql.mysql/usr/local/mysql
5. Initialize the database
cd/usr/local/mysql/scripts/
./mysql_install_db--user=mysql--basedir=/usr/local/mysql--datadir=/data
6. Registering MySQL Service
Cp/usr/local/mysql/support-files/mysql.server/etc/rc.d/init.d/mysqld
Cp/usr/local/mysql/support-files/my-default.cnf/etc/my.cnf
Chkconfig--add mysqld
Chkconfig mysqld on
7. Modification of environment variables
CD ~
VI. BASHRC
Add the following content
Path=/usr/local/mysql/bin: $PATH
export PATH
8. Configure user passwords and remote access permissions
Mysql-uroot
SET PASSWORD = PASSWORD (' 123456 ');
' root ' '% ' identified by with GRANT OPTION;
Compiling and installing mysql5.6.20