[HOW-TO] How the Windows platform compiles MySQL code

Source: Internet
Author: User
Tags manual documentation odbc mysql mysql code mysql manual mysql odbc driver
mysql|window| compilation
[HOW-TO] How the Windows platform compiles MySQL code



Author: Wang Mei (HeartIcy@163.com)

Revision: Initial

Date: July 13, 2003

Description: This is not a paper nor code reading guide, the purpose of writing this article is just to tell friends how to compile MySQL

Code, perhaps some people think that the code to compile MySQL from the Windows platform is somewhat complicated. If you have any questions about the knowledge mentioned in this article, you can ask for help through the CSDN MySQL board or the Mysql@china Support forum. There is nothing innovative about what is mentioned in this article, just a summary of the documentation that MySQL already has.

One, why to compile the code

When I was a little mother told me to do things first have a plan, or do not do things, so have a purpose. I don't know the friends who read this article

Friends you will pay attention to the MySQL manual. The MySQL Online handbook presents an "beyond" trend in the near future, and much of what is described in the manual is available in the development version, and I want to be able to get the test at the same time as I read it. At the same time, I also like other friends hate software There are various bugs, so I want to compile the code myself. Of course, my first intention was to get better performance from recompiling the MySQL code with Intel C + +.

Ii. How to prepare the code for compiling

This section contains the following points, please be aware.

Compiler

Cygwin

Memory

Patience



Compilers, the MySQL code can be compiled using GCC and vc6.0,vc7.1 under Cygwin. If you use Intel C + +

, I suggest you use it with VC6.0. The reason for not recommending VC 7.0 is that its own bugs (which have been repaired but are not publicly available). If you do not install the patch then it will cause errors (about inline optimizations can be temporarily resolved). VC6.0 Please install SP4 or SP5 and the corresponding processor support patch pack.

Most of Cygwin,mysql's code is written in Linux, so many utilities and configuration scripts are *nix wind

Lattice, so we need to use the Cygwin Unix simulation environment. When installing, select autoconf automake GNU make Libtool Bison perl. Another point is that the development of MySQL is managed using BK, and the BK client also needs to run with the help of Cygwin. If you just want to compile the officially published Windows code, you don't have to worry about that.

Memory, compiling MySQL code is very time-consuming, at least I think so. I suggest a machine with enough memory,

Otherwise, you'll have a feeling of dying (exaggerating ing ...). )。

Patience, the first time to compile MySQL especially in the development of the code will inevitably encounter all kinds of trouble, try to overcome them.

No one should be successful the first time, assuming that even these small problems can not be solved so what to read the code? So, give yourself some confidence, but also a little patience.

Iii. Acquisition of resources

I want to read it. The second section of the friend is ready for most things, in addition to compilers, Cygwin, we need to

The Ready BK client can go to the www.bitkeeper.com to download back. If you don't know Cygwin's web site then please come here to find www.cygwin.com.

When the tools are ready we visit mysql.bkbits.net, where we can see a table. Here's a table for each

Projects are corresponding to a MySQL project, and we are concerned about the project named mysql-4.1, which is currently the main focus of the MySQL 4.1.x version of the 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 top two commands, we can get and synchronize the development of the mysql4.1.x code, the first time to download the whole process is very slow about 100 m of things need to download, and then to extract and then synthesize the code. The other items listed in Mysql.bkbits.net are:



mysql-4.0

MySQL 4.0.X Development Tree

Mysqldoc

MySQL Documentation

Mysqlodbc3

MySQL ODBC Driver

mysql-3.23

MySQL 3.23.X Development tree, yesterday yellow.

mysql-4.1

MySQL 4.1.x Development tree, work focus.

mysql-5.0

MySQL Next Generation version

Mysqlcc

MySQL Control center

myodbc-3.52

Initial ODBC driver compatible with MySQL 4.1



 

 

 

 

 

 

 

We can all use the same way to get and synchronize code at any time.

Iv. Generating Windows Code

The default download back code is not suitable for direct use, copy the code to another directory, and then use the build directory

Utility Compile-pentium-max Configuration Code, after the configuration is complete, use the Scripts directory utility make_win_src_distribution produce a code that is appropriate for Windows use. This way the code gets the same as the official download of the Code provided, and the final product is a tar package. Execute these utilities, i.e. the shell script needs to be in the top directory of the code tree.

V. Compiling code

When the above work is done, compiling the code should be the easiest to open the project directly with VC 6.0 or Vc.net 2003.

File compilation is OK. The whole process does not need other libraries to assist, but also what difficulties.

Related website:

Mysql@china www.help2u.org

MySQL AB www.mysql.com

MySQL Mailing list lists.mysql.com

MySQL Defect Tracking Bugs.mysql.com

Finally, I wish you all good luck. In addition, it is also the most important. The MySQL code obtained in this article follows the GPL protocol, please refer to the GPL for more information.

 


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.