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.
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:
- 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