Xampp MySQL not starting – "Attempting to start MySQL service…" – Mysql

Photo of author
Written By M Ibrahim
apache-curator github-for-windows installation libmysqlclient xampp

Quick Fix: If MySQL is already running on your Windows system, stop the service via ‘services.msc’. Then, initiate MySQL from XAMPP to resolve the port conflict.

The Problem:

Problem Statement:

When attempting to start the MySQL service in XAMPP, the user encounters an endless loop of "Attempting to start MySQL service…" messages without any progress.

System Details:

  • XAMPP version: 3.2.1
  • Operating System: Windows
  • Apache status: Running on ports 80 and 443

The Solutions:

Solution 1: Check for a pre-installed MySQL instance

If you have previously installed MySQL on your Windows system, it may still be running in the background even after you’ve installed XAMPP. This can prevent XAMPP from starting MySQL successfully.

To resolve this issue:

  1. Open the Windows Services Manager by typing services.msc in the Start menu.
  2. Locate the MySQL service in the list of services.
  3. Right-click the MySQL service and select Stop.
  4. Once the MySQL service has been stopped, start XAMPP and try to start MySQL again.

XAMPP should now be able to start MySQL successfully on port 3306.

Solution 2: Reinstall XAMPP to a Different Location

To resolve the issue, consider reinstalling XAMPP to a different location, such as c:\xampp. This is because installing XAMPP in c:\windows\program files (x86) can lead to Windows permissions issues and hinder the successful startup of MySQL.

Solution 3: Change MySQL Port

Stop XAMPP. Then, go to the MySQL configuration. Change the port from 3306 to 3308. Save the changes. Finally, start MySQL.

Solution 4: Disable and Re-enable MySQL Service

  1. Open the Windows Command Prompt (cmd) as an administrator.

  2. Type the following command to disable the MySQL service:

    services.msc
    
  3. In the "Services" window, locate the "MySQL" service, right-click it, and select "Properties."

  4. In the "Startup type" dropdown menu, select "Disabled."

  5. Click "Apply" and then "OK" to save the changes.

  6. In the XAMPP Control Panel, uncheck the checkbox next to "MySQL" to uninstall it.

  7. Check the checkbox again to reinstall MySQL.

Solution 5: Windows 10 Users

If port 3306 is being used by another program, Windows 10 users may encounter this issue. To resolve this:

  1. Open the registry editor by pressing Win + R and typing regedit.

  2. Navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > MySql.

  3. Right-click on ImagePath and select Modify.

  4. Enter the location of the xampp mySqld file, which is usually:

    C:\xampp\mysql\bin\mysqld.exe
    

Then, restart the MySQL service.