1. 解决办法:Just uncheck and check button in Module Services column. It will automatically delete old service and start new service with new path. It happens when you delete xampp folder directly without stopping services.
即点击xampp面板上mysql旁边的绿色勾勾,即可重新卸载旧的服务安装新的mysql服务。同时最好把xampp上的mysql配置文件和xampp配置文件里的mysql端口都改成3307,以免和原来已经安装的mysql服务端口冲突。
若要重新启用原来安装的mysql,管理员权限登录cmd,D:\Program Files\MySQL\MySQL Server 5.5\bin>下mysqld.exe --install就重新安装了服务了
ps:修改原来机子的服务的名字可以完美解决MySQL Service detected with wrong path的问题,运行mysqld.exe --install --install MySQLhappy可以得到名字为MySQLhappy的服务名,那样就不会有上述的冲突了
=====================================================
以下是网上的解决办法,我试过了没有生效:
如果出现mysql 无法启动表明在安装xampp 前已经安装了mysql,造成mysql服务无法启动。
19:06:33 [mysql] MySQL Service detected with wrong path
19:06:33 [mysql] Change XAMPP MySQL and Control Panel settings or
19:06:33 [mysql] Uninstall/disable the other service manually first
19:06:33 [mysql] Found Path: "C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files (x86)\MySQL\MySQL Server 5.1\my.ini" MySQL
19:06:33 [mysql] Expected Path: d:\xampp\mysql\bin\mysqld.exe --defaults-file=d:\xampp\mysql\bin\my.ini mysql
为了把原来的mysql服务改成自己的mysql服务区需要修改mysql的执行文件路径
打开注册表
cmd
regedit
找到
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL] 中的ImagePath 修改成你当前的mysqld的执行目录
类似:"D:\xampp\mysql\bin\mysqld"
重新启动服务器成功!