I just set up a new Windows 7 machine, and built MySQL 5.6 for the first time, so I wanted to share my steps for anyone interested.
** Prerequisites **
1. Install Microsoft Visual Studio (I installed VS 2010 Express – free)
2. Install cmake
3. Install bison (make sure no spaces in path)
** Build Instructions **
cd c:\mysql\mysql-5.6.10 mkdir bld cd bld cmake .. cmake --build . --config relwithdebinfo --target package
(You don’t technically need the ‘bld’ dir, but I prefer it to keep the main dir ‘clean’. Then if you need to re-build, you can quickly just delete the whole ‘bld’ directory, and start fresh.)
Here is my actual output for those interested:
c:\>cd c:\mysql\mysql-5.6.10 c:\mysql\mysql-5.6.10>mkdir bld c:\mysql\mysql-5.6.10>cd bld c:\mysql\mysql-5.6.10\bld>cmake .. -- Building for: Visual Studio 10 -- Running cmake version 2.8.10.2 -- The C compiler identification is MSVC 16.0.30319.1 -- The CXX compiler identification is MSVC 16.0.30319.1 -- Check for working C compiler using: Visual Studio 10 -- Check for working C compiler using: Visual Studio 10 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 10 -- Check for working CXX compiler using: Visual Studio 10 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check size of void * -- Check size of void * - done -- MySQL 5.6.10 -- Packaging as: mysql-5.6.10-win32 -- Looking for include file sasl/sasl.h -- Looking for include file sasl/sasl.h - not found -- Looking for include file sys/devpoll.h -- Looking for include file sys/devpoll.h - not found -- Looking for include file signal.h -- Looking for include file signal.h - found -- Looking for include file sys/devpoll.h -- Looking for include file sys/devpoll.h - not found -- Looking for include file sys/epoll.h -- Looking for include file sys/epoll.h - not found -- Looking for include file sys/event.h -- Looking for include file sys/event.h - not found -- Looking for include file sys/queue.h -- Looking for include file sys/queue.h - not found -- Looking for TAILQ_FOREACH -- Looking for TAILQ_FOREACH - not found -- Looking for include file pthread.h -- Looking for include file pthread.h - not found -- Found Threads: TRUE -- Looking for _aligned_malloc -- Looking for _aligned_malloc - found -- Looking for _aligned_free -- Looking for _aligned_free - found -- Looking for fedisableexcept -- Looking for fedisableexcept - not found -- Looking for posix_memalign -- Looking for posix_memalign - not found -- Looking for ntohll -- Looking for ntohll - not found -- Looking for clock_gettime -- Looking for clock_gettime - not found -- Looking for epoll_create -- Looking for epoll_create - not found -- Looking for epoll_ctl -- Looking for epoll_ctl - not found -- Looking for inet_ntop -- Looking for inet_ntop - not found -- Looking for kqueue -- Looking for kqueue - not found -- Looking for kqueue -- Looking for kqueue - not found -- Looking for signal -- Looking for signal - found -- Looking for timeradd -- Looking for timeradd - not found -- Looking for timerclear -- Looking for timerclear - not found -- Looking for timercmp -- Looking for timercmp - not found -- Looking for timerisset -- Looking for timerisset - not found -- Check size of time_t -- Check size of time_t - done -- Performing Test TIME_T_UNSIGNED -- Performing Test TIME_T_UNSIGNED - Failed -- Looking for sched_getcpu -- Looking for sched_getcpu - not found -- Looking for asprintf -- Looking for asprintf - not found -- Using cmake version 2.8.10.2 -- Not building NDB -- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source. -- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80 -- Cannot find wix 3, installer project will not be generated -- Configuring done -- Generating done -- Build files have been written to: C:/mysql/mysql-5.6.10 c:\mysql\mysql-5.6.10\bld>cmake --build . --config relwithdebinfo --target package ... ... tons of build/compilation output ... ... 406 Warning(s) 0 Error(s) Time Elapsed 00:16:46.65
There you go!
The zip package (mysql-5.6.10-win32.zip in this case) will be located in bld/.
I will say that is a lot of warnings, though I’m fairly used to them on Windows. However, I plan to try VS 2012 Express to see if that makes any difference.
Hope this helps.
Related Build Links:
- Building MySQL and MariaDB on Windows using Visual Studio 2012 Express versus Visual Studio 2010 Express:
http://www.chriscalender.com/?p=1245 - How to Build MySQL 5.7 on Windows from Source Code:
http://www.chriscalender.com/?p=1273 - How to Build MySQL 5.6 on Windows from Source Code:
http://www.chriscalender.com/?p=1233 - How to Build MySQL 5.5 on Windows from Source Code:
http://www.chriscalender.com/?p=689 - How to Build MariaDB 10.0 on Windows from Source Code:
http://www.chriscalender.com/?p=1224 - How to Build MariaDB 5.5 on Windows from Source Code:
http://www.chriscalender.com/?p=1087 - Building MariaDB 5.3 on Windows:
http://www.chriscalender.com/?p=864 - Building MariaDB 5.1 on Windows:
http://www.chriscalender.com/?p=736 - Building MariaDB 5.1 on Windows Revisited:
http://www.chriscalender.com/?p=1256 - Troubleshooting Building MariaDB 5.1 on Windows:
http://www.chriscalender.com/?p=1259 - MySQL 5.5 Windows Build Appendix : Full Outputs and Common Errors from Building MySQL 5.5 on Windows:
http://www.chriscalender.com/?p=720 - Maintaining (and Building) your MySQL Source Tree on Windows:
http://www.chriscalender.com/?p=759 - Resolving the bison.exe m4 Invalid argument Error when building MySQL/MariaDB/XtraDB on Windows:
http://www.chriscalender.com/?p=798 - Resolving sasl/sasl.h Not Found during CMake when Building MySQL on Windows:
http://www.chriscalender.com/?p=1302 - Resolving Missing ‘sys’ Include Files: devpoll.h, epoll.h, event.h, and queue.h during CMake when Building MySQL on Windows:
http://www.chriscalender.com/?p=1317 - Building XtraDB on Windows:
http://www.chriscalender.com/?p=820