How to solve "Error: MySQL shutdown unexpectedly"?

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

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
  2. Make a copy of mysql/backup folder and name it as mysql/data
  3. Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders)
  4. Copy mysql/data_old/ibdata1 file into mysql/data folder
  5. Start MySQL from XAMPP control panel

And, voilà!


IMPORTANT Deleting this file may render any existing MySQL data unusable. Use with caution

Hey I just did this and it worked:

  1. exit Xampp server
  2. go to your C:\xampp\mysql\data directory
  3. delete the ibdata1 file
  4. restart xampp server

It should work


If the answers mentioned above are not working, you can try deleting all the files in data, except for the folder

Goto: C:\xampp\mysql\data

enter image description here

After that: Goto: C:\xampp\mysql\bin

then open with notepad my.ini , Its look like this.

enter image description here

Then delete or put into comment the port 3306 and change it to 8111 then run xamp with administrator and its work well.


  1. Go to mysql/data/
  2. Delete all random files (except the actual database folders)
  3. Restart Apache and MySQL.

It should fix it.