32-bit win7+vs2008 compile MySQL 5.6.22 source code and install

Source: Internet
Author: User
Tags mysql in

The
following installation instructions are from http://www.2cto.com/database/201407/316681.html win7+vs2010 source compiled MySQL, At the end of this article, we will explain some problems in compiling with vs2008 and the source code installation mysql5.6.22

Recently due to the internship, the focus is on some database development, in order to better understand the implementation of the database mechanism, the current initiation of the MySQL database to study the source of ideas. Well, say dry, first we need to implement the source code, here we choose win7+vs2010 to achieve, but tried many times have failed. This is the problem I encountered when I configured my environment many times, the various blog posts are always not quite complete, or there are no solutions to the problems encountered, which may be related to the specific operating system and environment. This article is about the situation I installed.

1. Preparatory work

(1) os:win7 flagship 64-bit + VS2010 (2013 also tried)

(2) MySQL source (Windows edition): Mysql-5.6.19.zip (down box select source code)

(3) Perl Tool:activeperl-5.16.3.1604-mswin32-x64-298023.msi

(4) cmake:cmake-3.0.0-win32-x86. exe

(5) Bison:bison-2.4.1-setup.exe

Installation needs to pay attention to the points, generally installed in the root directory, such as C:\Cmake C:\GnuWin32 C:\Perl64, of course, can also be other directories, the general path do not appear in Chinese characters, spaces and special characters (this seems very important). Specific installation See the following blog: windows+vs2012 environment compile debugging MySQL source code

In addition to bison installation needs to be aware of the unexpected, the other is almost the default installation, these details are best to follow, in order to avoid subsequent errors . Perl, Cmake, bison after the installation is finished, add the path of the bin under their installation directory to the environment variable (Windows environment variable added), such as C:\Cmake\bin. Okay, here's the basic OK. On the safe side we need to verify that the installation was successful:


2. Start the installation

Create a directory for installation in any of the disks you like: Create MySQL on the D drive and extract the Mysql-5.6.19.zip into the directory, then switch to the installation directory in CMD, which is D:\mysql\mysql-5.6.19, remember ({ install}=d:\mysql\mysql-5.6.19), which contains the following file directories:

Then execute the following command under {install}:

>mkdir BLD

>CD BLD

>cmake.

This allows you to see output similar to the following:

There are some errors that are not currently resolved, but in fact this does not affect our build vs under MySQL.sln project files. In fact, as long as you see the following, all kinds of not found also do not matter. If you use the CMake graphical interface, it's pretty much the same. Don't repeat it here.

Next we can build solution (corresponding build solution) in VS2010, but in order to minimize warnings or errors, we first need to modify the following files:

The method of modification is simple, which is to save the files in UTF-8 (with BOM header) format. General use of nodepad++ tools and so on.

The final step is to find the TEST_LC_TIME_SZ () function in {install}\mysql-5.6.19\sql\mysqld.cc, and change the Dbug_assert (0) to Dbug_assert (1).

At this point we have completed the purpose of converting the source code to the project file in vs. Then we can build the solution. If there is no error stating that there is no problem, some small warnings may be because the C + + compiler is stricter than the C compiler. Next we start debugging.

3. Commissioning

Then debug the MYSQLD Project: Properties, debugging, command parameters, set to --console, as follows:


Then launch the instance,

This allows you to see the following command-line interface:

CMD to enter the directory {install}\client, and then execute the following command, you can start to connect to the MySQL service just opened. This means that the MySQL service has been started and the next step is to start the MySQL customer service, where I start with the command line.


Ok so far, we basically completed in the Win7 under the VS compile debugging MySQL database, the following can begin to study the source code.

4. New Issues

(1) VS2010:

?
12 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 [F:\mysql\bld\CMakeFiles\CMakeTmp\cmTryCompileExec2556624813.vcxproj]解决办法:这是由于.NET中的cvtres.exe 与 VS2010中的有冲突,删掉VS2010中的cvtres.exe就可以了(目录F:\Install\VS2010\VC\bin),注意install是你安装VS2010的目录。

In order to better indicate the direction for the later, but also for the future to facilitate their own inquiries, so did this simple guide. Also want to follow this document installed friends encounter any problems can be explored together, and then constantly improve the document so that later people can be useful, while creating a responsible writing atmosphere.

win7+vs2008 compiled mysql5.6.22 source of some problems encountered and source installation

Under the Windows source MySQL 5.6.22, in the vs2008 compile the time to appear the error:

Error 1:

Error C2027: Undefined type ' std::basic_ostream<_elem,_traits> ' was used

Workaround: Add # include <iostream> in the dict0mem.h header file

Error 2:

ERR 460 Error C2440: "Initialize": Cannot convert from "Std::_tree<_traits>::const_iterator" to "Std::_tree<_traits>::iterator" D : \mysql\mysql-5.6.22\storage\innobase\handler\handler0alter.cc 4399

The workaround is to change the value of the assigned iterator iterator to Const_iterator

SOURCE Installation

There is an install project in the mysql5.6.22 source vs solution, and this project will install a MySQL in the C:/Program files path by default.


32-bit win7+vs2008 compile MySQL 5.6.22 source code and install

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.