Are you interested in MySQL? Do you want to know the internal implementation of MySQL?
If your answer is yes, I think you should want to see its source code. So how can we see its source code? Can I open files one by one, or can I open the entire project for debugging in IDE?
The following describes how to configure the environment to debug and learn the source code in visual studio2008. The premise is that you have downloaded the MySQL source code...
First, we need to download and install two software:
Cmake: can be downloaded from the http://www.cmake.org;
Bison: Download from http://gnuwin32.sourceforge.net/packages/bison.htm;
After the download, you must install it.
Step 2: You need to configure in the DOS environment. First, you need to enter the root directory of your MySQL source code in the DOS environment, and then run Configure. js under the win folder. The format is as follows:
C: \ sourcedir> win \ Configure. js options
Among them, options are options, and more importantly, the following options:
With_innobase_storage_engine: InnoDB Storage engine is supported.
With_archive_storage_engine: supports the archive storage engine.
With_blackhole_storage_engine: supports the blackhole storage engine.
With_sample_storage_engine: supports the sample storage engine.
With_ndbcluster_storage_engine: NDB Cluster Storage engine is supported.
Running the above c: \ sourcedir> win \ Configure. js options on DOS will eventually display a "done" Instruction statement, indicating that this step is complete.
Step 3, we need to generate our Visual Studio project based on the files starting with Build-Vs in the win folder.
In the DOS environment to run the build-vs9.bat file. As follows:
From the above we can see the last line "-- build files have been written to: H:/mysql-5.1.59", let's look at the file in the root directory, a vc project named 'all-build' and a MySQL solution are added. This indicates that the project has been generated. The effect is as follows:
Step 4: Open this project and set the mysqld project as the default startup item so that you can compile and debug MySQL.