How to compile MySQL code in Windows _ MySQL

Source: Internet
Author: User
Tags mysql code mysql manual
The purpose of this article is to show friends how to compile MySQL code. some people may think that compiling MySQL code on Windows is complicated. If you have any questions about the knowledge mentioned in this article, you can seek help through the CSDN MySQL board or the MySQL @ CHINA support forum. There is no innovation in the things mentioned in this article, just for My

The purpose of this article is to show friends how to compile MySQL code. some people may think that compiling MySQL code on Windows is complicated. If you have any questions about the knowledge mentioned in this article, you can seek help through the CSDN MySQL board or the MySQL @ CHINA support forum. There is no innovation in the things mentioned in this article, just a summary of the existing MySQL documents.

I. Why compile the code?

I don't know if you will pay attention to the MySQL manual when reading this article. The MySQL online manual has recently shown a "beyond" trend. most of the content described in this manual is available in development versions. I hope I can get a Test opportunity while reading it. At the same time, I hate various bugs in software like other friends, so I need to compile the code myself. Of course, my initial intention was to re-compile MySQL code with Intel C ++ for better performance.

II. how to prepare the compiled code

This part contains the following key points. Please note that.

■ Compiler

■ Cygwin

■ Memory

■ Patience

Compile MySQL code using GCC, VC6.0, and VC7.1 under Cygwin. If you use Intel C ++, we recommend that you use it with VC6.0. The reason why VC 7.0 is not recommended is its own BUG (fixed but not publicly available ), if no patch is installed, it will cause an error (inline optimization can be solved temporarily ). For VC6.0, install SP4 or SP5 and the corresponding processor support patch packages.

Most of Cygwin and MySQL code is written in Linux, so many utility tools and configuration scripts are in * nix style. Therefore, we need to use Cygwin as a Unix simulation environment. During installation, select autoconf automake gnu make libtool bison perl. In addition, bk is used for MySQL development, and bk Clients also need to run with cygwin. If you only want to compile the officially released Windows code, you do not need to care about this.

Memory, compilation of MySQL code is very time-consuming, at least I think so. I suggest you have a machine with enough memory. Otherwise, it will make you feel worse.

Patience: The first time you compile MySQL, especially the code in development, you will inevitably encounter various troubles and try to overcome them. No one should succeed for the first time. if these small problems cannot be solved, how can we read the code? Therefore, you have more confidence and patience.

3. obtain resources

In addition to the compiler and cygwin, we also need to prepare the bk client, which can be downloaded back. When the tools are ready, visit mysql.bkbits.net. here we can see a table. Each project in the table corresponds to a mysql project, and we care about the project named mysql-4.1, which is the current main focus of the MySQL 4.1.x development tree.

Get Code:

Shell> bk clone bk: // mysql.bkbits.net/mysql-4.1 mysql-4.1

Update code:

Shell> bk pull bk: // mysql.bkbits.net/mysql-4.1 mysql-4.1

With the above two commands, we can get and synchronize the MySQL4.1.x code in development at any time. if the first download is slow, there are about 100 MB of things to be downloaded, and then decompress and merge the code. Other projects listed in mysql.bkbits.net are:

We can use the same method to obtain and synchronize code at any time.

4. generate Windows code

By default, the downloaded code is not suitable for direct use. copy the code to another directory and use the utility compile-pentium-max under the BUILD directory to configure the code, after the configuration is complete, use the utility make_win_src_distribution in the scripts directory to generate a code suitable for Windows. the code obtained in this way is like the code officially downloaded. The final product is a tar package. Execute these utilities, that is, shell scripts, in the top-level Directory of the code tree.

5. compile the code

After completing the above work, it should be the easiest to compile the code. simply use VC 6.0 or VC. NET 2003 to open the project file for compilation. Other class libraries are not required for the whole process.

Finally, I wish you good luck. It is also the most important. The MySQL code obtained in this method follows the GPL protocol. For more information about GPL, see.

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.