This tutorial guides you on how to resolve XAMPP Error: MySQL shutdown unexpectedly. Did you open XAMPP Control Panel and run MySQL server which resulted in Error: MySQL shutdown unexpectedly ? Then you are at the right place.
XAMPP Error: MySQL shutdown unexpectedly
I had just started MySQL server from XAMPP Control Panel and got the following errors. This error says MySQL shutdown unexpectedly due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method.
Note, you may get this error if you had tried to end task “XAMPP Control Panel task” manually from Windows Task Manager. Therefore forcefully closing a program from task manager might also result with similar errors.
If you had not done anything or could not figure out what had went wrong, then follow the below section to fix the Error: MySQL shutdown unexpectedly. I would strongly recommend DON”T DELETE any MySQL database files as other posts are suggesting online in other forums.
Solved: Error: MySQL shutdown unexpectedly
1. First, take backup of MySQL data folder as shown below “data_backup“. You can also rename the existing /mysql/data folder to /mysql/data_backup folder
📂 mysql | — 📂 backup //Step 3: Copy all contents from this folder to data folder | — 📂 bin | — 📂 data //Step 2: Create new folder | — 📂 data_backup //Step 1: Rename existing data folder -> data_backup | — | — 📂 mysql | — | — 📂 phpmyadmin | — | — 📂 sneppets_wp //Step 4: Copy this database folder to /mysql/data | — | — 📜 ibdata1 //Step 5: Copy ibdata1 from backup folder to new folder (data) | — | — ---- | — | — ---- | — 📂 scripts | — 📂 share | — | — 📜 README.md | — | — 📜 mysql_installservice.bat | — | — 📜 mysql_uninstallservice.bat ---- ----
2. Next, create new folder named “data” as shown above under /mysql folder.
3. Then copy all the contents from /mysql/backup to the new folder created /mysql/data.
4. You need to copy all your database folders from your /mysql/data_backup folder to /mysql/data.
5. Finally, copy ibdata1 file from /mysql/data_backup to /mysql/data folder. This step will replace the existing ibdata1 folder in /mysql/data folder.
6. You are all set. Now you can go and try to start MySQL server again from the XAMP Control Panel app utility. It should work 🙂
Info: The file ibdata1 is called as MySQL system tablespace, which is located under c:/xampp/mysql/data/mysql. This single ibdata1 file contains all the tables and indexes in your MySQL database. Therefore you must copy this from your backup folder to the newly created folder.
That’s it. When you restarted you MySQL server the Error: MySQL shutdown unexpectedly should have gone away now !!.
Hope it helped 🙂
- XAMPP browser redirects to localhost/dashboard
- Guide to check XAMPP version on Windows.
- Default .htaccess file for WordPress website ?
- Error: Apache shutdown unexpectedly XAMPP
- PHP-FastCGI on Windows in XAMPP for PHP Performance
- PHP FPM – Check if Installed and Running
- With UAC please avoid installing XAMPP to C:\Program Files warning ?
- Best way to delete components in Angular 9 with CLI
- Dynamic and conditional CSS classes with ngClass : Angular
- Best way to delete components in Angular 9 with CLI ?
- Quickly create div classes in Visual Studio Code editor
- Global Angular CLI version is greater than your local version
- Create custom events and fire in Angular 9 with EventEmitter – Example
- Bind selected element from drop down to an object in Angular 9