MySQL內(nèi)核正確的編譯操作流程
編譯MySQL內(nèi)核是我們經(jīng)常用到的,以下的文章主要是介紹編譯MySQL內(nèi)核的正確方法,如果你對編譯MySQL內(nèi)核技術,心存好奇的話,以下的文章將會揭開它的神秘面紗。希望會給你帶來一些幫助在此方面。
關鍵字: MySQL內(nèi)核 數(shù)據(jù)庫安全配置 用戶認證模塊 密碼恢復 存儲過程編寫 數(shù)據(jù)庫索引
內(nèi)容摘要:
在***的版本中,windows環(huán)境與linux環(huán)境下使用一套代碼。本文以mysql-5.1.7作為分析的對象,詳細講解編譯MySQL內(nèi)核的方法。
在***的版本中,windows環(huán)境與linux環(huán)境下使用一套代碼。比如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。
詳細講解如何編譯MySQL內(nèi)核:這里我選擇5.1.7作為分析的對象。
安裝代碼的步驟:
1.解壓縮文件包mysql-5.1.7-beta-win-src.zip。
2.使用vs2003打開項目文件mysql.sln。
3.設置mysqld項目為啟動項目。
4.在mysqld的屬性頁設置命令參數(shù)為:--console。這樣就可以用debug方式調(diào)試代碼了。
配置命令參數(shù)
5.設置斷點,比如查詢的總?cè)肟谑莌andle_select函數(shù)。
6.編譯mysql項目,將會在mysql-5.1.7-betaclient_debug目錄下生成mysql.exe。
7.使用“啟動新實例”或者“進入單步執(zhí)行新實例”進行調(diào)試。
執(zhí)行調(diào)試操作
8. mysql-5.1.7-betaclient_debug目錄下生成mysql.exe,執(zhí)行語句,將會執(zhí)行到斷點進行調(diào)試。
進入調(diào)試狀態(tài)
9.相應的數(shù)據(jù)文件,見mysql-5.1.7-betadata目錄。
上述的相關內(nèi)容就是對詳細講解如何編譯MySQL內(nèi)核的描述,希望會給你帶來一些幫助在此方面。
【編輯推薦】
- Mysql大小寫中易出現(xiàn)的問題的解決
- MySQL隱藏空間相關問題的解答
- MySQL數(shù)據(jù)庫命令的基礎簡介
- MySQL數(shù)字類型中的三種常用種類
- MySQL 5.0基礎的基本內(nèi)容的介紹