MySQL官网上有deb包,但是这个帖子How to install MySQL 5.6?里说直接装deb很坑爹。本人就没尝试,有兴趣的朋友可以试试。
这里讲讲手动从源码安装MySQL-5.6.10的步骤。

1: 下载安装编译MySQL源码需要的库

firebird@locahost~$ sudo apt-get install build-essential libncurses5-dev cmake

2: 下载并解压MySQL源码包

firebird@locahost~$ cd /usr/local/src/
firebird@locahost:/usr/local/src$ sudo wget -O mysql-5.6.10.tar.gz http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/
firebird@locahost:/usr/local/src$ sudo tar -zxvf mysql-5.6.10.tar.gz

3: 使用cmake生成安装文件

创建一个文件夹来存放安装文件:

firebird@locahost:/usr/local/src$ cd mysql-5.6.10
firebird@locahost:/usr/local/src/mysql-5.6.10$ sudo mkdir my-build
firebird@locahost:/usr/local/src/mysql-5.6.10$ cd my-build

使用cmake生成安装文件,在这里你可能需要配置一些参数。具体参数可以查看MySQL Source-Configuration Options

firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo cmake ../

4: 安装MySQL

firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo make install

5: 将MySQL添加为开机启动的服务

firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ cd /usr/local/mysql
firebird@locahost:/usr/local/mysql$ sudo chown -R mysql .
firebird@locahost:/usr/local/mysql$ sudo chgrp -R mysql .
firebird@locahost:/usr/local/mysql$ sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql
firebird@locahost:/usr/local/mysql$ sudo chown -R root .
firebird@locahost:/usr/local/mysql$ sudo chown -R mysql data
firebird@locahost:/usr/local/mysql$ cd /usr/local/src/mysql-5.6.10/my-build
firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo cp support-files/mysql.server /etc/init.d/mysql
firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo cp support-files/mysql.server /etc/init.d/mysql
firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo update-rc.d mysql defaults

6: 启动MySQL服务器

firebird@locahost:/usr/local/src/mysql-5.6.10/my-build$ sudo /etc/init.d/mysql start