XAMPP Error: MySQL shutdown unexpectedly

XAMPP Error: MySQL shutdown unexpectedly

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.

XAMPP Error: MySQL shutdown unexpectedly

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 πŸ™‚

Also See:


Notify of

Inline Feedbacks
View all comments