1、下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择“Source Code”,

用已经注册好的oracle账户登录后才能下载,下载版本为mysql-5.6.15.tar.gz,也就是上图的最后一个包。

2:必要软件包

  1. yum -y install  gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make cmake 

3:安装编译【注意,xzvf和zxvf安装的路径是不用的】

[root@server182 ~]# groupadd mysql 
[root@server182 ~]# useradd -r -g mysql mysql 
[root@server182 ~]# tar -zxvf mysql-5.6.10.tar.gz 
[root@server182 ~]# cd mysql-5.6.10 
[root@server182 mysql-5.6.10]# cmake . 
[root@server182 mysql-5.6.10]# make && make install
-------------mysql默认被zxvf安装在/usr/local下,xzvf被安装在tar包所在的路径下
[root@server182 ~]# chown -R mysql.mysql /usr/local/mysql 
[root@server182 /usr/local/mysql]# chown -R root .
[root@server182 /usr/local/mysql]#chown -R mysql data
[root@server182 /usr/local/mysql]#chgrp -R mysql .
[root@server182 ~]# cd /usr/local/mysql/scripts [root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data -------------全部OK,没有报错,说明成功了 [root@server182 ~]# cd /usr/local/mysql/support-files [root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysqld [root@server182 support-files]# cp my-default.cnf /etc/my.cnf [root@localhost support-files]# chkconfig mysqld on [root@localhost support-files]# service mysqld start Starting MySQL SUCCESS! [root@localhost support-files]# cd /usr/local/mysql/bin/ [root@localhost bin]# ./mysqladmin -u root -p password Enter password: 直接按回车 New password: 输入新密码 Confirm new password:再次输入新密码 [root@localhost bin]# ./mysql -u root -p 【登录mysql平台】 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456789' WITH GRANT OPTION; mysql>quit; 开启防火墙的3306 [root@localhost bin]# vi /etc/sysconfig/iptables 在COMMIT前面加上 -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT service iptables restart

  

CMake has bootstrapped.Now run gmake.说明CMake已被设置为开机启动,现在运行gmake。