Are you having trouble with the XAMPP error: MySQL shutdown unexpectedly?
This is usually the result of corrupted files or an improper shutdown. Here is a simple step-by-step to fix the issue.
What can cause the error?
- Corrupted files
- Improper database shut down
- Missing files
- Port changes
Here’s what it looks like:
Steps to fix the problem
- Stop everything in XAMPP, specifically MySQL and Apache
- Go to your XAMPP folder and rename the /xampp/mysql/data folder to /xampp/mysql/data-old
- Create a new (empty) folder and name it “/xampp/mysql/data“
- Copy the folders from “/xampp/mysql/backup” and paste them into the new, empty “/xampp/mysql/data” folder
- Copy all the database folders from the “/xampp/mysql/data-old” folder and paste them into the “/xampp/mysql/data” folder
- Copy “ibdata1” and all of the log files with “ib_” prefixes (like ib_logfile0, ib_logfile1, etc) from “/xampp/mysql/data-old” and paste into the “/xampp/mysql/data” folder
- Start MySQL from the XAMPP control panel
That’s it! Now go to phpMyAdmin to check if all the databases are available and running properly.