How to Fix “Error: MySQL Shutdown Unexpectedly” in XMPP Local Environment

Post in English

If you encounter the error message “Error: MySQL shutdown unexpectedly” when starting MySQL in a XAMPP local environment, it means that MySQL did not shut down properly.

 

The repair method is as follows:

 

1, Go to the XAMPP folder.

 

2, Navigate to the mysql folder.

 

3, Open the data folder.

 

4, Copy the contents of the data folder and save it to a safe location (e.g., the desktop).

 

5, Once the copy is complete, delete all files inside the data folder.

 

6, Move all the files from the backup folder into the data folder.

 

7, ibdata1 file and if there is any custom-created folders inside the data folder that you saved earlier, copy them into the data folder as well.

 

8, Open phpMyAdmin from the MySQL Admin button and check if the database is restored correctly.

 

Once you start MySQL again and it works properly, the process is complete.