XAMPP Issue Screenshot
Error: MySQL shutdown unexpectedly
Method 1: mySQL server in XAMP don’t start
IMPORTANT: do NOT delete
ibdata1
file. You could destroy all your databases.
Deleting this file is like playing a Russian roulette with your databases, it could work and restablish everything, but also, probably could leave unusable every database you have.
This solution was taken from here
Instead, first try using the MySQL backup folder which is included with XAMPP. So do next steps:
- Rename folder
mysql/data
tomysql/data_old
(you can use any name) - Create a new folder
mysql/data
- Copy the content that resides in
mysql/backup
to the newmysql/data
folder - Copy all your database folders that are in
mysql/data_old
tomysql/data
(skipping themysql
,performance_schema
, andphpmyadmin
folders fromdata_old
) - Finally copy the
ibdata1
file frommysql/data_old
and replace it insidemysql/data
folder - Start MySQL from XAMPP control panel
An alternative post can be found here
XAMPP Fixed
Another issue:
I am using windows 10 brand new with no unwanted software or issues, and I got this unexpected shutdown again after a long time. I came to this question, hoping someone would tell me actually what was going on instead of fixing these issues. But unfortunately, I could not find it.
Just to clarify, this new issue is not with
- port
- unexpected shutdown
- windows stuck
- unwanted software
- virus or malware.
Method 2 (22 Dec 2021)
- Stop
MySQL.
- Go to the
C:/xampp/mysql
directory and copy thedata
folder and keep it somewhere else (probably in another drive) as a backup. - Go to your original
data
folder (C:/xampp/mysql
) and sort the files by ‘Type.’ - Select the files that have the type
INFO File
and delete them (screenshot below). - Start MySQL. It should work now.
Method 2 Screenshot