Installing MySQL from Source on Windows includes some information about building from source on Windows. The following discussion is specifically focused on building a version of MySQL containing the InnoDB Plugin.
You need the following tools:
A compiler environment, one of the following:
Microsoft Visual C++ 2003
Microsoft Visual C++ 2005
Microsoft Visual C++ 2008 (Note: for building MySQL 5.1.31 or later)
Microsoft Visual C++ 2005 Express Edition (free of charge)
Microsoft Visual C++ 2008 Express Edition (free of charge, for building MySQL 5.1.31 or later)
Download and install the Microsoft Visual C++ 2008 Express Edition. The Visual C++ 2008 Express Edition has already been integrated with the Windows SDK.
GNU Bison for Windows, a general-purpose parser generator that is largely compatible with Berkeley Yacc. This tool is used automatically as part of compiling and building MySQL. For most users, it is sufficient to download and run the “complete package” to install GNU Bison.
CMake 2.6.0 or later, a cross-platform make system that can generate MSVC project files.
In addition to installing these tools, you must also set CScript as the default Windows script host by executing the following command in the Command Prompt:
After you have installed and configured all the required tools, you may proceed with the compilation.
Download the MySQL source code, version 5.1.24 or later from the MySQL website and extract the source files.
Download the InnoDB plugin source code from the MySQL download site.
Extract the files from the source code archives.
Replace the contents of the
storage\innobasefolder in the MySQL source tree with the InnoDB plugin source tree.
In MySQL 5.1.38 and up, the MySQL source tree also contains a
storage\innodb_plugindirectory, but that does not affect this procedure. The source that you download from the InnoDB web site may contain additional changes and fixes.
Compile and build MySQL under the Microsoft Visual Studio Command Prompt as follows:
- Visual Studio 2003:
win\configure WITH_INNOBASE_STORAGE_ENGINE __NT__ win\build-vs7.bat devenv mysql /build release /project ALL_BUILD
- Visual Studio 2005:
win\configure WITH_INNOBASE_STORAGE_ENGINE __NT__ win\build-vs8.bat devenv mysql /build release /project ALL_BUILD
- Visual Studio 2008:
win\configure WITH_INNOBASE_STORAGE_ENGINE __NT__ win\build-vs9.bat vcbuild mysql.sln "Release"
For the 64-bit version, use
Install the compiled
sql\releasefolder of the source tree by doing one of the following:
binfolder of an earlier MySQL 5.1 installation.
Make a distribution package and unpack it to the folder where MySQL will be installed. See the MySQL manual section on make_win_bin_dist — Package MySQL Distribution as Zip Archive. Note that
scripts\make_win_bin_distrequires the Cygwin environment.
Reconfigure the MySQL server by editing the
my.inioption file to use InnoDB as the default engine (if desired) and set appropriate configuration parameters to enable use of new InnoDB Plugin features, as described in section Section 9.5, “Configuring the InnoDB Plugin”. In particular, we recommend that you set the following specific parameters as follows:
default_storage_engine=InnoDB innodb_file_per_table=1 innodb_file_format=barracuda innodb_strict_mode=1
Since you built a version of MySQL that contains the InnoDB Plugin, you do not have to specify
plugin-load, or issue any
INSTALL PLUGINstatements. The
mysqld.exethat you compiled contains the new InnoDB Plugin features.