Building MySQL 5.6 from source code


MySQl 5.6.10 is easily buildable from source code. In an earilier post I discussed the differences in using pre-packaged builds versus binaries bersus source code and had a few readers ask for details on building from scratch.

Step 1 — Download the source code from http://dev.mysql.com. Once again, you have the options of packages like RPM or a tar ball. In the following steps I usedthe good ol’ tar ball.

You too can build your own MySQL 5.6.10 from source code.

You too can build your own MySQL 5.6.10 from source code.

Step 2 — Unpack the downloaded code in the directory of your choice. I used the /usr/local/ of my Centos test server and executed tar xzf /home/dstokes/Downloads/mysql-5.6.10.tar.gz.

Step 3 — Inside /usr/local/mysql-5.6.10 you will find a file named INSTALL-SOURCE that you need to read. Section 2.9.2 covers building from a standard source distribution. There are lots of good details in there a DBA needs to know that I will have to truncate for brevity.

Step 4 — Next is to run cmake ., then make, and then make install. You make have to install some developer tools on your system if they were not added earlier and you need to have the apporpriate permissions on the box you are working on to put the pieces into place. And please note it takes a few minutes (or more) to get everything put together where a package manager can simply place the compiled files into their desired spot.

For those who have never built MySQL from scratch before, I suggest getting MySQL running from a package or binary distribution first so you KNOW the box will run MySQL. Second, when you start your new 5.6.10 server, make sure you point it to the right DATADIR from the previous version to make sure it works with known good data, I.E. ./bin/mysqld_safe –user=mysql –datadir=/usr/local/mysql-5.5/data.

-

About these ads

Leave a comment

Filed under MySQL

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s