XAMPP MySQL deactivated error

Installing XAMPP is a quick way to setup an Apache Server with PHP and a MySQL database.

But sometimes there's some kind of configuration error or bug that doesn't allow to start the MySQL service. Checking the status with the XAMPP control panel will display a message of "MySQL database DEACTIVATED".

How to fix the XAMPP MySQL deactivated bug

While I'm not sure about the causes of this error, there is a quick fix to activate MySQL in XAMPP following 2 simple steps.

First, try not to configure your MySQL database as a service. This is asked during the XAMPP installation. So don't select the checkbox of installing MySQL databases as a system service.

Second, create a basic configuration file for your new MySQL installation (you can do this automatically using Win MySQL admin).

Yes, there's an automated way to generate a basic config file for MySQL using tools installed by default in XAMPP. Just go to [XAMPP installation folder] / mysql / bin and run winmysqladmin.exe. Type a new username and password, and let the MySQL admin program generate the default mysql initialization file.

And that's it! A MySQL disabled as a Windows service, and a default configuration file with MySQL username and password defined should change your XAMPP SQL status from "MySQL database deactivated" to MySQL database ACTIVATED.

How to check that MySQL status is active

You can check the status of the MySQL databases opening the XAMPP control panel: MySQL should have a green running tag next to it.

Notice that I wouldn't keep using the Win MySQL Admin once you turned your MySQL service active: it's an old, discontinued application that seems to throw random Windows errors. But don't worry: just close the Win MySQL Admin window and keep using the built-in phpMyAdmin from the XAMPP default installation.

You can open the phpMyAdmin menu to check the active status of the MySQL databases from the XAMPP Apache main menu: start the Apache server, open the main server page using your web browser (just type "localhost" by default in your web browser address bar) and click the phpMyAdmin link to check that your MySQL databases are enabled.

I hope this helped you to activate your MySQL databases in XAMPP! Now, have a happy coding and local server testing!

If you have already created a basic configuration file, then there isn't much I could suggest you to try, as this solves most kind of Xampp MySQL conflicts.

Try to check the following:- The MySQL port is not in use.- There are neither antivirus applications nor firewalls blocking the MySQL port.- Try reseting the root user using the "resetroot.bat" inside the mysql folder of xampp.- Make sure XAMPP is installed into the default folder (C:\xampp) as well as the MySQL databases (C:\xampp\mysql). On the contrary, there could be some file path issues.- If everything else failed, make sure there aren't older MySQL installations on your PC. They could be creating a conflict with the newer MySQL install. If you are not sure about this, try uninstalling the MySQL databases, using a registry cleaner software, and then installing XAMPP again.

I hope this helped to solve the problem. If you finally found out the solution, please tell us about it!

True, the last versions of xampp don't bundle a "winmysqladmin.exe" file, but a "mysqladmin.exe" instead.

I thought they would do pretty much the same, but according to your feedback, the new one does not seem to work.

So, in that same folder (... xampp\mysql\bin\), the first step to check is whether do you have a my.ini file or not. If you do, check the variables and paths inside. If you don't, well, you'll be needing a new one, definitely.

I have the same problem here but I could not even run mysql after doing all these things. I have unstalled it multiple times even deleted all the folders on C for mysql. Now in service i can see the name but could not delete values from there and could not solve after installing xampp again and again. Please help.

It is possible to install XAMPP on Windows 7. However, you need to have administrator permissions, you need to make sure all necessary ports are free (including port 80 - try the port check feature on XAMPP to verify this point) and you should be installing it on the root path (C:\xampp) since installing it for example on the Program Files (x86) folder would give you some path mapping problems.

As far as I know, there's no 64-bit version of XAMPP, but I've heard that it is still possible to run it on Windows 7 with a default path installation.