Fixes for localhost WordPress and PHP development using XAMPP – MySQL: Unexpected Shutdown

XAMPP Issue Screenshot

Error: MySQL shutdown unexpectedly

Method 1: mySQL server in XAMP don’t start

IMPORTANT: do NOT delete ibdata1 file. You could destroy all your databases.

Deleting this file is like playing a Russian roulette with your databases, it could work and restablish everything, but also, probably could leave unusable every database you have.

This solution was taken from here

Instead, first try using the MySQL backup folder which is included with XAMPP. So do next steps:

  1. Rename folder mysql/data to mysql/data_old (you can use any name)
  2. Create a new folder mysql/data
  3. Copy the content that resides in mysql/backup to the new mysql/data folder
  4. Copy all your database folders that are in mysql/data_old to mysql/data (skipping the mysql, performance_schema, and phpmyadmin folders from data_old)
  5. Finally copy the ibdata1 file from mysql/data_old and replace it inside mysql/data folder
  6. Start MySQL from XAMPP control panel

An alternative post can be found here


Another issue:

I am using windows 10 brand new with no unwanted software or issues, and I got this unexpected shutdown again after a long time. I came to this question, hoping someone would tell me actually what was going on instead of fixing these issues. But unfortunately, I could not find it.

Just to clarify, this new issue is not with

  • port
  • unexpected shutdown
  • windows stuck
  • unwanted software
  • virus or malware.

Method 2 (22 Dec 2021)

  1. Stop MySQL.
  2. Go to the C:/xampp/mysql directory and copy the data folder and keep it somewhere else (probably in another drive) as a backup.
  3. Go to your original data folder (C:/xampp/mysql) and sort the files by ‘Type.’
  4. Select the files that have the type INFO File and delete them (screenshot below).
  5. Start MySQL. It should work now.

Method 2 Screenshot

enter image description here


0 thoughts on “Fixes for localhost WordPress and PHP development using XAMPP – MySQL: Unexpected Shutdown