Download, configure, compile, and install MySQL 5.6

MySQL 5.6 is the latest production-ready release of the most popular open source database management system on the planet ie. MySQL.

In this tutorial, I am going to tell you how to download, configure (for installation purposes only), compile, and install MySQL 5.6 (more specifically 5.6.10) from source code on a Linux machine. You can read my other tutorials on geeksww.com "Install MySQL Server 5.0 and 5.1 from source code" and "Install MySQL Server 5.5 from source code" for previous versions of MySQL server. Please prepare yourself to install several libraries on the server before installing MySQL 5.6. Luckily, I have already written about their installation process in my previous tutorials.

Please make sure you check the downloaded file's integrity before unzipping it. '#' (w/o quotes) in front of commands below means you have to run the commands as root user (or use sudo ).

Here are the libraries and softwares you need to install alongwith their installation tutorials (some tutorials are outdated ie. they are for older versions of libraries, so try finding the latest stable releases for all software systems and libraries before installing). In any case, you should try using properly tested binaries that come with your OS distribution (recommended for production):

Installing libaio on Linux:

InnoDB Plugin 1.1 (default since MySQL 5.5) now uses asynchronous I/O on Linux systems. This change introduces a dependency on libaio.

$ cd /opt
$ wget http://www.morphisms.net/~wkj/download/libaio.tbz
$ bunzip2 libaio.tbz
$ tar xf libaio.tar

After installing all these software, let's begin with the actual server installation process.

Download and extract MySQL 5.6.10:

Please make sure you check file's integrity after downloading (before installing).

$ wget http://www.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/
$ tar xzf mysql-5.6.10.tar.gz
$ cd mysql-5.6.10

Configure and compile MySQL 5.6.10:

Please make sure you replace path locations according to your environment in commands below (if you are following my earlier tutorials for installation of required libraries then it is quite possible that you installed them under /usr/local/, if so please adjust the path in command below):

$ PATH=$PATH:/opt/bison/bin   #bison binary should be in your path

$ cmake . -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/opt/mysql-5.6.10/data/ 
-DCMAKE_INSTALL_PREFIX=/opt/mysql-5.6.10 -DCURSES_LIBRARY=/opt/ncurses/lib/libncurses.a 
-DCURSES_INCLUDE_PATH=/opt/ncurses/include/ -DHAVE_LIBAIO_H=/opt/libaio/include/ 
 -DINSTALL_LAYOUT=STANDALONE -DENABLED_PROFILING=ON 
-DMYSQL_MAINTAINER_MODE=OFF -DWITH_DEBUG=OFF -DDEFAULT_CHARSET=utf8 
-DENABLED_LOCAL_INFILE=TRUE -DWITH_ZLIB=bundled

$ make

Install MySQL 5.6.10:

# make install

You can initialize the server you just installed by using the instructions explained in Initializing MySQL database after installation.

Did this tutorial help a little? How about buy me a cup of coffee?

Buy me a coffee at ko-fi.com

Please feel free to use the comments form below if you have any questions or need more explanation on anything. I do not guarantee a response.

IMPORTANT: You must thoroughy test any instructions on a production-like test environment first before trying anything on production systems. And, make sure it is tested for security, privacy, and safety. See our terms here.

Comments (write a comment):

Installation of MySQL 5.6.10 is giving a lot of trouble on my Ubuntu 12.10.

"CMake Error: The source directory "~/Downloads/mysql-5.6.10" does not appear to contain CMakeLists.txt."

After going through lot of tutorials, all in vain; I came across your tut here, and felt a little relief. I installed all the prerequisites given here, all as advised. But this too didn't work for me. It is giving the same error. Even I tried the x64 version but not of much use, except a lot of time waste on my slow internet speeds.

Please help me find a solution sooner.
Thank you in advance. Posted by: vikas on Mar 05, 2013

UPDATE:
As of today, the latest source is 5.6.15 and can be downloaded with

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.15.tar.gz Posted by: Dimitry on Jan 20, 2014

All gone well up to the last command 'make' under your heading 'Configure and compile MySQL 5.6.10:' - 'make' exits with the following mesasge

mysql-5.6.10/cmd-line-utils/libedit/terminal.c:1677: error: expected ‘{’ at end of input
make[2]: *** [cmd-line-utils/libedit/CMakeFiles/edit.dir/terminal.c.o] Error 1
make[1]: *** [cmd-line-utils/libedit/CMakeFiles/edit.dir/all] Error 2
make: *** [all] Error 2

Have put more than 3 days on it so far but still don't know what is the cause. Regards AH Posted by: Abb on Mar 21, 2014

@Abb: not sure what it is, did you check file's integrity after downloading it?

see http://www.geeksww.com/tutorials/libraries/apr_util/installation/installing_apache_portable_runtime_utility_library_on_ubuntu_linux.php for some inspiration on how to use checksums Posted by: shahryar on Apr 08, 2014

leave a comment on tutorial leave a comment