The purpose of this article is simply to tell friends how to compile MySQL code, and perhaps some people think that the code compiled from the Windows platform MySQL is somewhat complicated, but it is not. 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
I don't know if you will notice the MySQL manual for the friend reading this article. 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 are using Intel C + +, I recommend that you work with VC6.0. The reason that VC 7.0 is not recommended is that its own bugs (which have been repaired but not publicly provided) will cause errors if not patched (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 styles, so we need to use the Unix simulation environment Cygwin. 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 having a machine with enough memory, or else it will make you feel alive.
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
In addition to the compiler, Cygwin we also need to prepare BK client, can be downloaded back. When the tools are ready we visit mysql.bkbits.net, where we can see a table. Here's a table for each item that corresponds to a MySQL project, 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