In this tutorial I will show you How to fix MySQL Shutdown Unexpectedly in Xampp Server.
Stop Apache server
Before we start first we need to stop the Apache server. Now Go to C:\Xampp\mysql folder.
Create backup of data folder
Now we need to create a backup of the data folder, so use any Compression folder like winrar or winzip or use windows 11 built in feature “compress to zip file”. Right click on the data folder and click on “Compress to Zip file” . It will create a zip file of the data folder.
Rename data folder
Now rename the data folder to data_old.
Create new data folder
Now we need to create a folder called data.
Copy data from backup folder
Now copy all the data from the backup folder & paste them inside the data folder.
Copy database folders
Now copy only the database folders from data_old folder & paste all the database folders inside the newly created data folder.
Please note that we pnly need to copy the database folders, do not copy any other folders such as mysql, phpMyAdmin etc.
Copy ibdata files
Now open data_old folder & copy these files : ib_buffer_pool, ib_logfile0, ib_logfile1 & ibdata1 & paste these files in the newly created data folder(Choose replace the files in the destination).
Restart Xampp
Now restart Xampp Server & start Apache & Mysql.
Check Databases in phpMyadmin
Now open your browser & open phpMyAdmin by entering this url http://localhost/phpmyadmin/ & check databases.
Databases restored
You can see that the problem has been fixed and all the databases are restored.
rẩt hay
cảm ơn