What to do for the ‘MySQL Service Detected With Wrong Path’ error message?

What to do for the ‘MySQL Service Detected With Wrong Path’ error message?

There are certain error messages in MySQL that lack pointers to the error source. In such cases, it becomes pretty hard to fix the error. One such error message is the ‘MySQL Service Detected with Wrong Path’ error. This problem occurs even after you’ve configured MySQL properly. In this article, learn two ways how you can fix this issue.

What is the ‘MySQL Service Detected with Wrong Path’ error message?

You’re most likely to get this error message when running multiple instances of MySQL on the server.

Take an example of XAMPP. This software distribution is a bundle of the following four services:
  • Apache web server
  • MySQL database
  • PHP
  • Perl
At times, there can be conflict between these services, which would lead to the error message. The complete error message looks like this:

Code:
21:01:50 [mysql] MySQL Service detected with wrong path
21:01:50 [mysql] Change XAMPP MySQL and Control Panel settings or
21:01:50 [mysql] Uninstall/disable the other service manually first
It’s more common in Windows systems.

How to fix this Error?

The solution to this problem depends on the exact cause. And there are two primary causes.

There are multiple instances of MySQL service

As already mentioned, the main reason behind this error is that there are multiple instances of MySQL service running on the same server. There’s a chance that they are in conflict with each other.

By default, MySQL will listen at the port 3306. If there are multiple MySQL instances, then they may utilize the same port.

To fix this issue, you need to analyze the applications active on your server. If you have XAMPP, then you can uninstall the default MySQL instance. That’s because XAMPP has its own web server and database.

You can uninstall using the following command:

Code:
sc delete mysql
Next, you need to run XAMPP as an admin and install MySQL service to the XAMPP interface.

In case you need both MySQL service, it’s advised that you set up the other MySQL instance on another port. This way, there will be no interference.

In XAMPP, you need to edit the my.ini file that’s located at c:\xampp\mysql\bin\. Within this file, find the default port option and change it to a value other than 3306. In addition to that, edit the mysql.default_port parameter in the same file.

Lastly, add the Windows Registry entry and restart the server.

Incorrect MySQL service path

There’s another common reason why you may get this error message. And that is if the MySQL service path is not mentioned correctly.

For example, let’s say you uninstall the default MySQL service and install the XAMPP service in its place. But in the Windows services list, you’ll find that the default MySQL service is listed and it has the old path name.

To fix this issue, you need to update the path name.

If you’re on the Windows server, you need to go to the HKEY_LOCAL_MACHINE > SYSTEMS > CurrentControlSet > Services > MySQL file and update the MySQL path name under the ImagePath parameter.

In case of XAMPP, you need to update the MySQL path name like the following:

Code:
"c:\xampp\mysql\bin\mysqld.exe" --defaults-file="c:\xampp\mysql\bin\my.ini" MySQL
So that’s how you fix the ‘MySQL Service Detected with Wrong Path’ error message. For further assistance, contact the hosting support team.
Author
kumkumsharma
Views
718
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top