How to Fix Error: MySQL Shutdown Unexpectedly
Published on
When experiencing the “error: MySQL shutdown unexpectedly“, you can fix it with several methods, from deleting some data folder files to creating a data_old folder.
Such errors can disrupt your activities as you use XAMPP as a web server to develop a web on localhost. It’s better if you address the problem immediately.
So, how to run XAMPP normally again without any errors: MySQL shutdown unexpectedly messages? Check out some tricks bellow to be able to install WordPress on XAMPP.
Table of Contents
How to Fix Error: MySQL Shutdown Unexpectedly
Errors that occur during the XAMPP running process commonly looks like the image above. In the image, there are red error messages that indicates the MySQL database software cannot run.
13:55:17 [mysql] Error: MySQL shutdown unexpectedly. 13:55:17 [mysql] This may be due to a blocked port, missing dependencies, 13:55:17 [mysql] improper privileges, a crash, or a shutdown by another method. 13:55:17 [mysql] Press the Logs button to view error logs and check 13:55:17 [mysql] the Windows Event Viewer for more clues 13:55:17 [mysql] If you need more help, copy and post this 13:55:17 [mysql] entire log window on the forums
To overcome this, you can use the following methods:
1. Shut down XAMPP Service
First, to solve the Error: MySQL shutdown unexpectedly is by deleting or moving the unused database folder. Here are the steps:
- Step 1: Turn off all active XAMPP services through the Control Panel by clicking Stop.
- Step 2: Open the folder (C:) > xampp > mysql > data.
- Step 3: Delete or move unneeded database folders. If you want to delete, you should back them up first.
- Step 4: Run the XAMPP web server again.
2. Delete Files in MySQL Data
If the previous solution doesn’t work, you can try the second method by deleting some log files for MySQL. The steps are almost the same as the previous method.
- Step 1: Turn off all active XAMPP services through the XAMPP Control Panel by clicking Stop.
- Step 2: Open the folder (C:) > xampp > mysql > data.
- Step 3: Delete the ib_logfile0, ib_logfile1, and ibdata1 files.
- Step 4: Run the XAMPP web server again.
3. Create a New Data Folder
The third way to resolve the error: MySQL shutdown unexpectedly is to create a new data folder and separate some of its contents into another folder.
- Step 1: Enter the folder (C:) > xampp > mysql > data.
- Step 2: Rename the data folder to data_old.
- Step 3: Create another new folder with the name ‘data‘.
- Step 4: Copy all the files in the backup folder into the newly created data folder.
- Step 5: Copy all the files in the data_old folder (except the mysql, performance_schema, and phpmyadmin folders) into the data folder.
- Step 6: Copy and replace the ibdata1 file in the data_old folder into the data folder.
- Step 7: Run XAMPP again and you’re all set.
4. Reinstall XAMPP
Another way to solve Error: MySQL shutdown unexpectedly is to reinstall XAMPP. Here are the steps:
- Step 1: Enter the Control Panel.
- Step 2: Select the Programs menu.
- Step 3: Now, click on the Uninstall a program option.
- Step 4: Select the XAMPP application and click Uninstall/Change. Then do the uninstall.
- Step 5: Please install the XAMPP files again.
5. Turn off other Web Servers (WampServer)
If you are using another web server such as WampServer on your PC and it is still active, then you cannot run XAMPP at the same time. This is due to the same port is being used.
If WampServer is still active, then you can disable it first by left-clicking on the WampServer tray icon > click the Stop All Services menu. > Done, you can try running XAMPP again.
Have You Successfully Resolved the MySQL Error on XAMPP?
Those are several ways to resolve Error: MySQL shutdown unexpectedly when trying to run XAMPP. By doing so, you can continue developing the web on XAMPP localhost.
Yes, indeed there can be various challenges in website development. If you prefer to avoid the difficulties of building a website, you can reach out to the Tonjoo Team through Contact Tonjoo.
We have extensive experiences in building and developing various types of websites, ranging from government websites to corporate ones. Let’s collaborate to develop your website with a design that sets it apart from the rest.
Updated on May 15, 2023 by Moch. Nasikhun Amin