重新安裝MySql,提示服務啓動失敗

windows XP sp3環境中,重新安裝MySql5.5,總是在安裝之後的配置嚮導的最後一步啓動不了服務,提示“could not start the service MYSQL. Error:0”。然後手動到services.msc中啓動MySql服務,仍是報錯:MySql錯誤:1067 進程意外終止。

百度了一下,都是說是因爲之前的沒有卸載乾淨導致的,另外提供了徹底刪除MySql的方法,包括:

卸載前,手動stop MySql服務;

卸載後手動刪除安裝目錄文件;

手動刪除AppData目錄殘留文件;

手動刪除註冊表HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services中的信息。

上面幾種方法都試過之後,仍然是服務啓動失敗。

後來使用bing搜索英文網站,搜到一篇帖子http://blog.webhostingdiscussion.net/mysql/how-to-completely-remove-mysql-from-windows-system.htm,裏面寫到在一個帖子裏看到:

For Windows 7 and Windows 2008 server:
[1] Uninstsall MySQL server from “Add/Remove Programs”
[2] Delete C:\Program Files\MySQL [Make sure that you delete the data related to MySQL server]
[3] Delete C:\Program Files (x86)\MySQL [Make sure that you delete the data related to MySQL server]
[4] Delete C:\ProgramData\MySQL [Make sure that you delete the data related to MySQL server]
[5] Delete from any Users’ AppData folders.
Example: C:\Users\Administrator\AppData\Roaming\MySQL
[6] Reinstall MySQL server


For Windows 2003 (may work for Windows XP):
[1] Delete the associated data directory. On Windows XP and Windows Server 2003, before MySQL 5.1.24, the default data directory would be located within the MySQL installation directory.
[2] On MySQL 5.1.24 and later, the default data directory is the configured AppData directory, which is C:\Documents and Settings\All Users\Application Data\MySQL by default.


After following above steps, if you still see “MySQL” in the service list, run the following command in command prompt to remove the service:
sc delete MySQL
If your service name is MySQL5 or other replace MySQL with appropriate name.
If you want to keep your databases as they, make sure you take backup of “data” directory instead of removing this folder. You should be able to restore your data directory once MySQL server is re-installed successfully.


其中,紅色那行起到了作用,原來MySql使用的是All User\Application Data。手動刪除它,然後清理安裝目錄殘餘文件、清理註冊表信息。重新安裝、配置,一切OK。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章