It is common for XAMPP’s MySQL to suddenly stop starting, causing site and development environment outages. This is mainly due to MySQL data becoming corrupted from forced shutdowns of XAMPP.

This article introduces successful recovery methods without reinstalling XAMPP itself, along with specific examples. Additionally, it explains how to check error logs when problems occur.

Why does MySQL fail to start?

XAMPP’s MySQL is prone to data corruption caused by sudden forced shutdowns or system shutdowns. Especially,

  • corruption of the ibdata1 file
  • inconsistencies related to aria_log files

are common causes.

How to check MySQL error logs

When MySQL fails to start, the first step is to check the error logs to investigate the cause.

Location of error logs

Normally, XAMPP’s MySQL error logs are found at the following locations:

C:\xampp\mysql\data\mysql_error.log

or

C:\xampp\mysql\data\<computer name>.err

(File names may vary depending on XAMPP version or settings.)

Steps to check error logs

  1. Open the C:\xampp\mysql\data folder in Explorer
  2. Open the mysql_error.log or files with .err extension using a text editor (such as Notepad or VSCode)
  3. The end part of the log (latest entries) contains error details. You can find hints about startup failure reasons or file corruption.
  4. Sending the code to ChatGPT or Gemini to get detailed explanations of the errors can be helpful.

Recovery Method Case 01: Data backup and restore from backup

  1. Backup the entire MySQL data folder
    Copy all files and folders inside C:\xampp\mysql\data to another safe location.
  2. Delete database folders you created, such as WordPress databases
    Delete all database folders you created inside C:\xampp\mysql\data (for example, WordPress database folders).
  3. Overwrite with backup data
    Copy all files from C:\xampp\mysql\backup to C:\xampp\mysql\data and overwrite existing files.
  4. Restore the backed-up database folders
    Return the database folders you backed up in step 1 to C:\xampp\mysql\data (mainly those deleted in step 2).
  5. Very important: Restore the backed-up ibdata1 file
    Overwrite the ibdata1 file backed up in step 1 to C:\xampp\mysql\data.

Recovery Method Case 02: Restart by deleting aria_log files

Deleting the following files in the MySQL data folder of XAMPP may allow MySQL to start.

  • C:\xampp\mysql\data\aria_log.00000001
  • C:\xampp\mysql\data\aria_log_control

Please be sure to back up these files before deleting.

Summary

  • When MySQL does not start, first check the error logs to understand the cause.
  • Be careful not to accidentally delete or overwrite the important ibdata1 file.
  • It is also worth trying to delete the aria_log related files.
  • If recovery is still not possible, consider reinstalling XAMPP.