How to Solve Error: MySQL Shutdown Unexpectedly XAMPP (5 Ways)
Advertisements
Encountering the “MySQL shutdown unexpectedly” error while using XAMPP can be frustrating, especially if you’re in the middle of developing a website on your localhost.
Fortunately, there are several methods to resolve this issue, such as deleting specific files in the data folder or creating a data_old folder.
So, how can you get XAMPP running normally again without this error? Check out these solutions to ensure a smooth installation of WordPress on XAMPP.
Advertisements
How to Fix “MySQL Shutdown Unexpectedly” Error in XAMPP
If you’re encountering an error while running XAMPP, you might see a red error message indicating that the MySQL database software has failed to start. The error message typically looks like this:
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
This issue can occur due to several reasons, such as port conflicts, missing dependencies, improper permissions, or database crashes. To resolve it, try the following methods:
1. Shut Down XAMPP Services & Remove Unused Database Files
This method involves deleting or moving unnecessary database folders:
- Step 1: Stop all active XAMPP services via the XAMPP Control Panel by clicking Stop.
- Step 2: Navigate to (C:) > xampp > mysql > data.
- Step 3: Delete or move old and unused database folders (backup before deleting).
- Step 4: Restart XAMPP and try running MySQL again.
Advertisements
2. Delete MySQL Log Files
If the first method doesn’t work, try deleting MySQL log files:
- Step 1: Stop all XAMPP services via the XAMPP Control Panel.
- Step 2: Navigate to (C:) > xampp > mysql > data.
- Step 3: Delete the following files:
– ib_logfile0
– ib_logfile1
– ibdata1 - Step 4: Restart XAMPP and check if MySQL starts normally.
These methods should help resolve the issue and get MySQL running smoothly again.
3. Create a New Data Folder
This method involves renaming the data folder and replacing its contents:
Baca Juga
- Step 1: Go to (C:) > xampp > mysql > data.
- Step 2: Rename the data folder to data_old.
- Step 3: Create a new folder and name it data.
- Step 4: Copy all files from the backup folder into the newly created data folder.
- Step 5: Copy all files from data_old (except the mysql, performance_schema, and phpmyadmin folders) into data.
- Step 6: Copy and replace the ibdata1 file from data_old to data.
- Step 7: Restart XAMPP and check if MySQL works.
Advertisements
4. Reinstall XAMPP
If MySQL still doesn’t start, reinstalling XAMPP might be the best option:
- Step 1: Open Control Panel.
- Step 2: Click Programs.
- Step 3: Select XAMPP and click Uninstall/Change.
- Step 4: Uninstall XAMPP completely.
- Step 5: Download and reinstall XAMPP.
Advertisements
5. Stop Other Web Servers (e.g., WampServer)
If WampServer or other web servers are running, they might be using the same port as XAMPP, causing conflicts.
- Step 1: Click on the WampServer tray icon.
- Step 2: Select Stop All Services.
- Step 3: Restart XAMPP and check if MySQL runs normally.
By following these solutions, MySQL should be back up and running in no time!
Advertisements
Successfully Fixed MySQL Error on XAMPP?
Those were several ways to fix the “MySQL shutdown unexpectedly” error when running XAMPP. Now, you can continue developing your website on localhost smoothly.
Website development often comes with challenges, but you don’t have to face them alone. If you need a hassle-free solution, Tonjoo is here to help!
We have extensive experience in building and developing various types of websites, from government portals to corporate websites. Let’s create a standout website with Tonjoo! Contact us now through Tonjoo’s Contact Page.
Read related articles on WordPress, WooCommerce, Plugins, and other web development topics by Moch. Nasikhun Amin on the Tonjoo Studio blog.
Advertisements