Developers have reported encountering the “Error: MySQL shutdown unexpectedly” when attempting to launch the MySQL server via the XAMPP web server control panel. Occasionally, a failure to connect to the database on a WordPress website may occur as a result of MySQL not being operational or an unexpected shutdown.
In this article will discuss how to fix the “Error: MySQL shutdown unexpectedly” issue in the XAMPP server without losing a single data from your MySQL database.
Some people could suggest you delete/replace the “data/backup” folder from MySQL. Inside those folders, there has a file called “ibdata1“. If you delete this file you could destroy all of your databases. So, STOP deleting or replacing the “data/backup” folder, particularly the “ibdata1” file.
mysql/data folded to
mysql/data_old ( you can choose any name for “
data_old” you want )
Create a new folder name as “
Copy all files from the “
mysql/backup“ folder to the “
Copy all your database folders that are in the “
mysql/data_old“ to “
Copy the “
ibdata1“ file from “
mysql/data_old“ and replace it inside “
Finally, start MySQL from the XAMPP control panel.