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。
--转自