How to fix Error: MySQL shutdown unexpectedly
This is a very common issue for developers. You can fix this issue without uninstalling the XAMPP.
Don’t delete ibdata1 file. Otherwise your database will be destroyed.
- First Take the back of the MySQL backup folder (
xampp/mysql/backup
). - Rename the MySQL data folder to data_old (
xampp/mysql/data
toxampp/mysql/data_old)
. - Now create a new MySQL data(
xampp/mysql/data
) folder. - After that copy all data from the MySQL folder (
xampp/mysql/
) and paste in the data(xampp/mysql/backup
) folder. - Now copy all the database folder from
xampp/mysql/data_old
and paste in thexampp/mysql/data
folder .(exceptmysql
,performance_schema
, andphpmyadmin
folders). - Copy
xampp/mysql/data_old/ibdata1
paste intoxampp/mysql/data
folder. - After this restart the MySQL from the XAMPP Control panel.