MySQL5.1安裝時(shí)出現(xiàn)Cannot create windows service for mysql.error:0
2016-09-03 16:52:0213850
安裝MySQL5.1過(guò)程中,我把以前MySQL5.0的GUI工具和服務(wù)器全部刪掉,安裝目錄全部刪掉,數(shù)據(jù)文件目錄名字改掉,注冊(cè)表用完美卸載清理了。 然后重啟安裝MySQL5.1(我以前遇到過(guò)服務(wù)啟動(dòng)不了的情況,這樣做就搞定了),可配置到最后一步時(shí)出現(xiàn)Cannot create windows service for MySQL.error:0錯(cuò)誤,把配置工具關(guān)掉重?幾次都不行,后來(lái)百度了下,聽(tīng)說(shuō)要在系統(tǒng)?理員用戶下執(zhí)行sc delete mysql刪除MySQL服務(wù)后再啟動(dòng)配置工具配置,實(shí)在不行重啟后再試。 我刪掉服務(wù)再配置還是同樣錯(cuò)誤,再刪掉服務(wù),重啟后配置還是不行。 又在網(wǎng)上參考了好些文章,最后解決辦法如下:
2.刪除C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/data目錄下ib_logfile0、ib_logfile1兩個(gè)文件刪除,順便說(shuō)句,此目錄下有個(gè)err文件,是以主機(jī)名命名的,里面記載著錯(cuò)誤信息,類似下面這段:
InnoDB: The first specified data file E:/Data/ibdata1 did not exist:
InnoDB: a new database to be created! 090501 19:20:08 InnoDB: Setting file E:/Data/ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... InnoDB: Error: log file ./ib_logfile0 is of different size 0 48234496 bytes InnoDB: than specified in the .cnf file 0 17825792 bytes! 090501 19:20:09 [ERROR] Plugin 'InnoDB' init function returned error. 090501 19:20:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 090501 19:20:09 [ERROR] Unknown/unsupported table type: INNODB 090501 19:20:09 [ERROR] Aborting 090501 19:20:09 [Warning] Forcing shutdown of 1 plugins 090501 19:20:09 [Note] E:/Program Files/MySQL/MySQL Server/bin/mysqld: Shutdown complete