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):
- How to download, compile, and install GNU ncurses on Debian/Ubuntu Linux
- How to download and install Bison (GNU Parser Generator)
- How to download, compile, and install CMake on Linux
- Installing libaio on Linux
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.
Please feel free to use the comments form below if you have any questions or need more explanation on anything. I recommend thoroughy testing on a production-like test system first before moving to production. Use the icons below to share this tutorial with your friends.