XAMPP Fixer is a script created in C# which fixes the common "Error: MySQL shutdown unexpectedly." error from XAMPP.
XAMPP Fixer performs the following actions:
- [OPTIONAL] Creates a backup of existing database files in case of failure.
- The backup will be created at
\xampp\mysql\data-backups\data-CURRENT_UNIX_TIMESTAMP
- The backup will be created at
- Renames
\xampp\mysql\data
to\xampp\mysql\data-temp
. - Copies
\xampp\mysql\backup
to\xampp\mysql\data
. - Moves required database files from
\xampp\mysql\data-temp
back to\xampp\mysql\data
, excluding a few files, such asmysql
,performance_schema
,phpmyadmin
, andtest
. - Deletes the temporary directory
\xampp\mysql\data-temp
I've done this manually each time XAMPP broke, but after some time it gets repetitive, so I've created this script.