MySQL5.6 can only be compiled with CMake, so it is now written about the mysql5.6 installation and compilation method.
For CMake installation and compilation, see http://thankinglove.blog.51cto.com/2311485/1791792
#!/bin/bash#install_mysql-5.6.21.tar.gzcat /etc/passwd | grep "^mysql:" if [ $? -ne 0 ]then groupadd mysqlficat /etc/passwd | grep "^mysql : "if [ $? -ne 0 ]thenuseradd -g mysql mysql -s /usr/sbin/ nologinfi//create MySQL directory and data directory mkdir -p /usr/local/mysqlmkdir -p /usr/local/mysql/data// Change owner chown -r mysql:mysql /usr/local/mysql//Source package is placed in the/USR/LOCAL/SRC directory Cd /usr/local/srctar xzvf mysql-5.6.21.tar.gzcd mysql-5.6.21cmake -dcmake_install_prefix=/usr/local/mysql -dmysql_datadir=/usr/local/mysql/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 -dextra_charsets= All -ddefault_charset=utf8 -ddefault_collation=utf8_general_cimakemake installcp /usr/local/mysql/support-files/ my-default.cnf /usr/local/mysql/my.cnf//Initializing Database/usr/local/mysql/scripts/mysql_install_db --datadir=/ usr/local/mysql/data --basedir=/usr/local/mysql --user=mysql//Copy startup script cp /usr/local/mysql/ support-files/mysql.server /etc/init.d/mysqlchmod +x /etc/init.d/mysqlif [ -e / etc/my.cnf ]thenmv /etc/my.cnf /etc/my.cnf.bakfichkconfig --add mysqlchkconfig Mysql on
Start MySQL after installation is complete
Service MySQL start//to see if MySQL started successfully netstat-tnlp | grep ": 3306" ps aux | grep MySQL
This article is from the "Ubuntu" blog, so be sure to keep this source http://thankinglove.blog.51cto.com/2311485/1791790
mysql5.6 Installation