MySQL 5.1 Reference Manual  /  Installing and Upgrading MySQL  /  Installing MySQL from Source

2.11 Installing MySQL from Source

Building MySQL from the source code enables you to customize build parameters, compiler optimizations, and installation location. For a list of systems on which MySQL is known to run, see

Before you proceed with an installation from source, check whether we produce a precompiled binary distribution for your platform and whether it works for you. We put a great deal of effort into ensuring that our binaries are built with the best possible options for optimal performance. Instructions for installing binary distributions are available in Section 2.2, “Installing MySQL on Unix/Linux Using Generic Binaries”.

To obtain a source distribution for MySQL, see Section 2.1.2, “How to Get MySQL”. MySQL source distributions are available as compressed tar files, Zip archives, or RPM packages. Distribution files have names of the form mysql-VERSION.tar.gz,, or mysql-VERSION.rpm, where VERSION is a number like 5.1.73.

To perform a MySQL installation using the source code:

To install MySQL from source, the following system requirements must be satisfied:

  • GNU gunzip to uncompress the distribution and a reasonable tar to unpack it (if you use a .tar.gz distribution), or WinZip or another tool that can read .zip files (if you use a .zip distribution).

    GNU tar is known to work. The standard tar provided with some operating systems is not able to unpack the long file names in the MySQL distribution. You should download and install GNU tar, or if available, use a preinstalled version of GNU tar. Usually this is available as gnutar, gtar, or as tar within a GNU or Free Software directory, such as /usr/sfw/bin or /usr/local/bin. GNU tar is available from

  • A working ANSI C++ compiler. GCC 3.4.6 or later, Sun Studio 10 or later, Visual Studio 2005 or later, and many current vendor-supplied compilers are known to work.

  • A good make program. Although some platforms come with their own make implementations, it is highly recommended that you use GNU make 3.75 or newer. It may already be available on your system as gmake. GNU make is available from

  • libtool 1.5, available from 1.5.24 or later is recommended.

If you run into problems and need to file a bug report, please use the instructions in Section 1.7, “How to Report Bugs or Problems”.

Download this Manual
User Comments
  Posted by Chris Calender on January 18, 2012
How to Build MySQL 5.5 from Source Code on Windows
  Posted by Anoop Viswanath on July 2, 2014
Detailed instructions for compiling MySQL Server from source code on Linux.

This one worked for me.
Sign Up Login You must be logged in to post a comment.