Fixing “MySQL Shutdown Unexpectedly” Error in XAMPP – Quick & Effective Guide

Cách fix lỗi không start được mysql trong xampp - YouTube

 

If you’re facing the “MySQL shutdown unexpectedly” error in XAMPP, don’t worry. This guide will walk you through step-by-step solutions to fix the issue quickly and effectively.

Common Causes

  • Port conflict: MySQL port 3306 or Apache ports 80/443 are used by other programs like Skype.

  • Corrupted MySQL data: The data folder contains corrupted files.

  • Insufficient access rights: XAMPP is not running with Administrator privileges.

  • Firewall blocking Apache: The firewall prevents Apache from running.


How to Fix It

1. Restart the MySQL Service

If MySQL won’t start, follow these steps:

  • Open your XAMPP installation folder.

  • Go to the mysql directory.

  • Run the following files one by one:

    • mysql_uninstallservice.bat

    • resetroot.bat

    • mysql_installservice.bat

  • Restart XAMPP and try running MySQL again.


2. Check and Change Apache Ports

If Apache won’t start, it could be due to port conflicts.

a. Change Port 443 (HTTPS)

  • Open XAMPP Control Panel.

  • Click “Config” next to Apache, then open httpd-ssl.conf.

  • Replace all instances of 443 with 4433.

  • Save the file and restart Apache.

b. Change Port 80 (HTTP)

  • In XAMPP Control Panel, click “Config” next to Apache, then open httpd.conf.

  • Replace all 80 with 8080.

  • Save and restart Apache.

  • After changes, access localhost via: http://localhost:8080.


3. Allow Apache Through Firewall

When starting Apache, if a firewall alert appears, click “Allow Access” to permit it to run.


4. Check for Software Using the Same Ports

Apps like Skype can occupy port 80 or 443 and cause conflicts.

  • Exit Skype and try restarting Apache.

  • Or, change Apache’s ports as shown in step 2.


Tips

  • Always run XAMPP as Administrator to ensure services have the required permissions.

  • Restart your computer after making configuration changes.

  • If the problem persists, check the error.log file in the apache/logs folder for more details.


Technical Support

Need more help? Contact us:

We hope this guide helps you solve the “MySQL shutdown unexpectedly” issue in XAMPP efficiently.