Category: MySQLUniversity

How to Build MySQL on Windows/Presentation

Contents

[edit] Introduction

[edit] It's not hard!

[edit] Setting up Shop

[edit] Setting up Bitkeeper, Bison, and CMake


[edit] Visual Studio 2005 Express and SDK

[edit] ActiveState Perl/Cygwin

[edit] Understanding CMake

SET(CMAKE_CXX_FLAGS_DEBUG 
     INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include 
                         ${CMAKE_SOURCE_DIR}/extra/yassl/include)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc 
                            ${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc 
                            ${PROJECT_SOURCE_DIR}/include/sql_state.h 
                             PROPERTIES GENERATED 1)

[edit] Building the server

[edit] Configure the server

[edit] Build the server (Visual Studio)

[edit] Build the server (command line)

[edit] Running the test suite

[edit] Debugging

[edit] In Visual Studio 2005 (x32 or x64) and Express (x32)

Image:Winbuild_Startup_se.png‎ Image:Winbuild_Startup_menu.png‎

Image:WinBuild_Debug_opt.png

[edit] With the standalone debuggers

Image:windbg.png Image:cdb.png

[edit] Debugging mysqld when run as a service

Image:Attach.png

Image:Attach2.png

[edit] Debugging mysqld when run during a test suite run

[edit] Common Tasks

[edit] Adding a new source file

 ADD_EXECUTABLE(mysqld
                ../sql-common/client.c derror.cc des_key_file.cc
                ....
                ${PROJECT_SOURCE_DIR}/sql/lex_hash.h)

[edit] Changing a compiler or linker setting

 ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
  TARGET_LINK_LIBRARIES(mysqld
                        heap myisam myisammrg mysys yassl zlib debug dbug yassl 
                        taocrypt strings vio regex wsock32 ws2_32)
  ADD_DEPENDENCIES(mysqld GenError)

[edit] Helpful Tools and Links

[edit] Notes from Windows Task Force (WTF) team members

BK Woes


If you use cygwin and bk commit complains that it cannot execute the pre-commit trigger, you need to change the first line in the trigger from "#!/bin/sh" to "#!/bin/ash" in the directory .\bitkeeper\triggers. This doesn't happen often and it was supposed to be fixed but I still run into it now and again.

Of course, there the usual problems if sendmail doesn't work. Your commit will work but to get the email sent you can either fix sendmail then redo the commit or open the commits.txt file in .\bitkeeper\tmp, copy it into a new email message and send it (that only works if you haven't done another commit of course).

Intellisense


As for intellisense, it usually craps out after 5 or 6 builds with heavy mods. I work in the replication code mostly and that touches everything (or vice-versa) so when I build a great many files have to be built. There is no outward bad thing that goes on when intellisense fails -- compilation still works, it just stops doing autocomplete (something I would loathe to do without). To fix it, you just exit VS and delete the MySQL.ncb file in the root source tree. Then restart VS and wait for it to rebuild (usually only takes about 5 minutes).

Vista


- win/configure versus win\configure and how the former silently fails on some Windows variants

Retrieved from "http://forge.mysql.com/wiki/How_to_Build_MySQL_on_Windows/Presentation"

This page has been accessed 3,971 times. This page was last modified 14:13, 6 September 2007.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...