详细讲解如何编译MySQL内核

美丽人生00111

美丽人生00111

2016-02-19 18:03

想要天天向上,就要懂得享受学习。图老师为大家推荐详细讲解如何编译MySQL内核,精彩的内容需要你们用心的阅读。还在等什么快点来看看吧!

  在最新的版本中,windows环境与linux环境下使用一套代码。比如mysql-6.0.4-alpha版本中的INSTALL-WIN-SOURCE文件的描述:

  TobuildMySQLonWindowsfromsource,youmustsatisfythe
  followingsystem,compiler,andresourcerequirements:
  *Windows2000,WindowsXP,ornewerversion.WindowsVistais
  notsupporteduntilMicrosoftcertifiesVisualStudio2005on
  Vista.
  *CMake,whichcanbedownloadedfromhttp://www.cmake.org.
  Afterinstalling,modifyyourpathtoincludethecmake
  binary.
  *MicrosoftVisualC++2005ExpressEdition,VisualStudio.Net
  2003(7.1),orVisualStudio2005(8.0)compilersystem.
  *IfyouareusingVisualC++2005ExpressEdition,youmust
  alsoinstallanappropriatePlatformSDK.Moreinformationand
  linkstodownloadsforvariousWindowsplatformsisavailable
  fromhttp://msdn.microsoft.com/platformsdk/.
  *IfyouarecompilingfromaBitKeepertreeormakingchanges
  totheparser,youneedbisonforWindows,whichcanbe
  downloadedfrom
  http://gnuwin32.sourceforge.net/packages/bison.htm.Download
  thepackagelabeled"Completepackage,excludingsources".
  Afterinstallingthepackage,modifyyourpathtoincludethe
  bisonbinaryandensurethatthisbinaryisaccessiblefrom
  VisualStudio.
  *Cygwinmightbenecessaryifyouwanttorunthetestscript
  orpackagethecompiledbinariesandsupportfilesintoaZip
  archive.(Cygwinisneededonlytotestorpackagethe
  distribution,nottobuildit.)Cygwinisavailablefrom
  http://cygwin.com.
  *3GBto5GBofdiskspace.

  通过这样的方法,生成项目文件,从而可以通过vs工具进行编译。在先前的版本中,windows下的代码和linux下的代码是两个压缩包,比如windows下的一个软件包名为,mysql-5.1.7-beta-win-src.zip。

  这里我选择5.1.7作为分析的对象。

  安装代码的步骤:

  1.解压缩文件包mysql-5.1.7-beta-win-src.zip。

  2.使用vs2003打开项目文件mysql.sln。

  3.设置mysqld项目为启动项目。

  4.在mysqld的属性页设置命令参数为:--console。这样就可以用debug方式调试代码了。

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

图1:配置命令参数

  5.设置断点,比如查询的总入口是handle_select函数。

  6.编译mysql项目,将会在mysql-5.1.7-betaclient_debug目录下生成mysql.exe。

  7.使用“启动新实例”或者“进入单步执行新实例”进行调试。

图2:执行调试操作

(本文来源于图老师网站,更多请访问https://m.tulaoshi.com/bianchengyuyan/)

  8. mysql-5.1.7-betaclient_debug目录下生成mysql.exe,执行语句,将会执行到断点进行调试。

图3:进入调试状态

  9.相应的数据文件,见mysql-5.1.7-betadata目录。

展开更多 50%)
分享

猜你喜欢

详细讲解如何编译MySQL内核

编程语言 网络编程
详细讲解如何编译MySQL内核

内核编译

Linux Linux命令 Linux安装 Linux编程 Linux桌面 Linux软件 Linux内核 Linux管理
内核编译

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

编译内核的步骤

Linux Linux命令 Linux安装 Linux编程 Linux桌面 Linux软件 Linux内核 Linux管理
编译内核的步骤

linux内核编译详解

Linux Linux命令 Linux安装 Linux编程 Linux桌面 Linux软件 Linux内核 Linux管理
linux内核编译详解

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

linux内核的编译

Linux Linux命令 Linux安装 Linux编程 Linux桌面 Linux软件 Linux内核 Linux管理
linux内核的编译

MySQL/Postgrsql 详细讲解如何用ODBC接口访问MySQL指南

编程语言 网络编程
MySQL/Postgrsql 详细讲解如何用ODBC接口访问MySQL指南

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

MySQL代码如何在 Windows环境下编译

MySQL代码如何在 Windows环境下编译

流行的非主流网名 烟火、绚烂我的寂寞

流行的非主流网名 烟火、绚烂我的寂寞
下拉加载更多内容 ↓