<!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 pt</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- [if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:標準の表; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]-->
安裝 MySQL 5.1
MySQL 安裝的步驟也很簡單:
1. 將下載回來的 mysql-noinstall-5.1.xx-win32.zip 解壓縮到 D:/AppServ 下,然後把 mysql-5.1.xx-win32 這個資料夾名稱改為 mysql 。
2. 複製 D:/AppServ/mysql/my-medium.ini ( 或其他) 為 my.ini 。
註:寫這篇文章的時候, MySQL 最新的版本是 5.1.38 ,然後我用 –defaults-file 指定外部的 my.ini ,但卻一直無法讓 MySQL 啟動;因此我就放棄用外部 my.ini 了,直接讓 MySQL 抓取安裝目錄下的 my.ini 。
然後找到 my.ini 裡的:
/tmp/mysql.sock
改為:
D:/Temp/mysql.sock
註:在 [client] 和 [mysqld] 區段裡各有一個,都要改。
Temp 路徑請自行決定。
3. 然後在 [mysqld] 下一行加入:
4. basedir = D:/AppServ/mysql
datadir = D:/AppServ/data
以設定 MySQL 的執行路徑及資料庫存放路徑。
5. 接著在 DOS 命令列下執行:
C:/>mysqld --install
註: MySQL 5.1.21 以後的版本就沒有 mysqld-nt 這支程式了。
6. 然後再執行:
C:/>NET START MYSQL
或用服務管理員來啟動 MySQL
7. 如果要移除服務,就用:
C:/>mysqld --remove
這樣就能完成 MySQL 的安裝了。