How to Solve Error: MySQL Shutdown Unexpectedly XAMPP (5 Ways)

Nasikhun A. 07 Mar 2025 3 Menit 0

Advertisements

Encountering the “MySQL shutdown unexpectedly” error while using XAMPP can be frustrating, especially if you’re in the middle of developing a website on your localhost.

Fortunately, there are several methods to resolve this issue, such as deleting specific files in the data folder or creating a data_old folder.

So, how can you get XAMPP running normally again without this error? Check out these solutions to ensure a smooth installation of WordPress on XAMPP.

Advertisements

How to Fix “MySQL Shutdown Unexpectedly” Error in XAMPP

How to Solve Error: MySQL Shutdown Unexpectedly XAMPP

If you’re encountering an error while running XAMPP, you might see a red error message indicating that the MySQL database software has failed to start. The error message typically looks like this:

13:55:17 [mysql] Error: MySQL shutdown unexpectedly. 13:55:17 [mysql] This may be due to a blocked port, missing dependencies, 13:55:17 [mysql] improper privileges, a crash, or a shutdown by another method. 13:55:17 [mysql] Press the Logs button to view error logs and check 13:55:17 [mysql] the Windows Event Viewer for more clues 13:55:17 [mysql] If you need more help, copy and post this 13:55:17 [mysql] entire log window on the forums

This issue can occur due to several reasons, such as port conflicts, missing dependencies, improper permissions, or database crashes. To resolve it, try the following methods:

1. Shut Down XAMPP Services & Remove Unused Database Files

This method involves deleting or moving unnecessary database folders:

  1. Step 1: Stop all active XAMPP services via the XAMPP Control Panel by clicking Stop.
  2. Step 2: Navigate to (C:) > xampp > mysql > data.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  3. Step 3: Delete or move old and unused database folders (backup before deleting).
  4. Step 4: Restart XAMPP and try running MySQL again.

Advertisements

2. Delete MySQL Log Files

If the first method doesn’t work, try deleting MySQL log files:

  1. Step 1: Stop all XAMPP services via the XAMPP Control Panel.
  2. Step 2: Navigate to (C:) > xampp > mysql > data.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  3. Step 3: Delete the following files:
    ib_logfile0
    ib_logfile1
    ibdata1
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  4. Step 4: Restart XAMPP and check if MySQL starts normally.

These methods should help resolve the issue and get MySQL running smoothly again.

3. Create a New Data Folder

This method involves renaming the data folder and replacing its contents:

  1. Step 1: Go to (C:) > xampp > mysql > data.
  2. Step 2: Rename the data folder to data_old.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  3. Step 3: Create a new folder and name it data.
  4. Step 4: Copy all files from the backup folder into the newly created data folder.
  5. Step 5: Copy all files from data_old (except the mysql, performance_schema, and phpmyadmin folders) into data.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  6. Step 6: Copy and replace the ibdata1 file from data_old to data.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  7. Step 7: Restart XAMPP and check if MySQL works.

Advertisements

4. Reinstall XAMPP

If MySQL still doesn’t start, reinstalling XAMPP might be the best option:

  1. Step 1: Open Control Panel.
  2. Step 2: Click Programs.How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  3. Step 3: Select XAMPP and click Uninstall/Change.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  4. Step 4: Uninstall XAMPP completely.
  5. Step 5: Download and reinstall XAMPP.

Advertisements

5. Stop Other Web Servers (e.g., WampServer)

If WampServer or other web servers are running, they might be using the same port as XAMPP, causing conflicts.

  1. Step 1: Click on the WampServer tray icon.
    How to Fix "MySQL Shutdown Unexpectedly" Error in XAMPP
  2. Step 2: Select Stop All Services.
  3. Step 3: Restart XAMPP and check if MySQL runs normally.

By following these solutions, MySQL should be back up and running in no time!

Advertisements

Successfully Fixed MySQL Error on XAMPP?

Those were several ways to fix the “MySQL shutdown unexpectedly” error when running XAMPP. Now, you can continue developing your website on localhost smoothly.

Website development often comes with challenges, but you don’t have to face them alone. If you need a hassle-free solution, Tonjoo is here to help!

We have extensive experience in building and developing various types of websites, from government portals to corporate websites. Let’s create a standout website with Tonjoo! Contact us now through Tonjoo’s Contact Page.

Error: MySQL Shutdown Unexpectedly XAMPP


Read related articles on WordPress, WooCommerce, Plugins, and other web development topics by Moch. Nasikhun Amin on the Tonjoo Studio blog.


 

Share to:
Nasikhun A.
Written by

Nasikhun A.

Moch. Nasikhun Amin is an SEO Technical Writer at Tonjoo. His writing specializes in topics including, but not limited to, WordPress, WooCommerce, and Web Development. Every piece of content he creates undergoes testing and technical review by the software engineering team.

Advertisements

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.