1.mysql-5.6.26 the source version of the installation method is: http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.26.tar.gz/from/http:// Mysql.mirror.rafal.ca/2.tar XF mysql-5.6.26.tar.gz-c/usr/src/cd/usr/src/mysql-5.6.26/ --mysql5.5 version requires CMake (c language compiler) to compile the installation
Yum Groupinstall "Development tools"-yyum install gcc gcc-c++ ncurses-devel perl ---------Avoid subsequent troubleshooting and install all dependent packages ( It will be mentioned later when you do not install GCC to perform make && make install error) yum install Cmake-ycmake. -dcmake_install_prefix=/usr/local/mysql56-ddefault_charset=utf8-ddefault_collation=utf8_general_ci-dwith_extra _charsets=gbk,gb2312-denabled_local_infile=1-dwith_innobase_storage_engine=1
echo $?-->1 error yum install-y gcc-c++ (preferably just start wrapping all dependencies) Rm-f CMakeCache.txt re-execute Cmake-->echo $?-->0
3. Manually write MY.CNF configuration file mkdir/usr/local/mysql/etc vim/usr/local/mysql/etc/my.cnf[mysqld]port=3306 # # # # # The default port 3306 can not be specified datadir=/datapid-file=/var/run/mysqld/mysql.pidsocket=/data/mysql.socketlog-error=/var/log/ Mysqld/mysql-err.log[client]socket=/data/mysql.socket4. Initializing MySQL and starting MySQL initialization:/usr/local/mysql/scripts/mysql_ install_db--defaults-file=/usr/local/mysql/etc/my.cnf--basedir=/usr/local/mysql--user=mysql ------------- First create a MySQL user start:/usr/local/mysql/bin/mysql --defaults-file=/usr/local/mysql/etc/my.cnf & ----> Check whether to start successfully lsof-i:3306 if the view log is not started, Tail-200/var/log/mysqld/mysql-err.log
It is a good disk space to report errors, affecting data writing. Ll/data a few three files are relatively large. Remove this three files after cleaning up disk space rm-f/data/ib* ------> restart.
5. cp/usr/local/mysql/bin/mysql /usr/bin/mysql56 --if you often get the above command longer, you can copy it to/usr/bin and rename it to Mysql56, In the future, using the MYSQL56 command to launch it is much easier to copy boot files to/ETC/INIT.D, Cp/usr/local/mysql56/support-files/mysql.server /etc/init.d/ Mysql56 Modifying the mysql56 configuration file vim/etc/init.d/my.cnfconf=/etc/my.cnf modify it to conf=/usr/local/mysql/etc/my.cnf (The configuration file can be created at the beginning of/etc, directly copied over without modification)
Compiling and installing mysql5.6