How can I solve “Error: MySQL shutdown unexpectedly”?

Important: do not delete the 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Ă !

As mentioned by some users, this is an emergency solution, not a permanent one. After recovering your data is strongly recommended to back it up, and reinstalling XAMPP, because the failure is related to a malfunction from some of the files of XAMPP, not the databases.

Leave a Comment