Ugacomp

Solved: XAMPP Error: MySQL shutdown unexpectedly.

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM

CLOUD VPS M

$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM

CLOUD VPS L

$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

When you’re running XAMPP on your local machine, you’re likely to face the error: MySQL shutdown unexpectedly. This error prevents the MSQL server from starting, something that can hamper your project.

12:21:29  [mysql] 	Error: MySQL shutdown unexpectedly.
12:21:29  [mysql] 	This may be due to a blocked port, missing dependencies, 
12:21:29  [mysql] 	improper privileges, a crash, or a shutdown by another method.
12:21:29  [mysql] 	Press the Logs button to view error logs and check
12:21:29  [mysql] 	the Windows Event Viewer for more clues
12:21:29  [mysql] 	If you need more help, copy and post this
12:21:29  [mysql] 	entire log window on the forums
12:21:33  [mysql] 	Attempting to start MySQL app...
12:21:33  [mysql] 	Status change detected: running
12:21:34  [mysql] 	Status change detected: stopped

To fix the Error: MySQL shutdown unexpectedly, we need to follow these steps:

Navigate to the MYSQL subdirectory

The MYSQL subdirectory is located inside the XAMPP directory under the following path in Windows:

C:\xampp\mysql

Make a copy of the data subdirectory

While inside the MYSQL subdirectory, our main attention should be put on the data subdirectory:

The clone copy of the data subdirectory can be made by right-clicking on it, copying, and pasting.

Enter into the data subdirectory

Now that we’ve backed up the data folder, we need to click on it and go inside; This is what you gonna see:

Delete all the files and folders except your app database subdirectory and the ibdata1 file. In this example, my app database subdirectory is called your_App_db. In your case, this could be different so you have to be sure as deleting this subdirectory could mean that you’re going to lose your application database files.

Whatever is highlighted in this screenshot shouldn’t be deleted but remove everything else:

Go to the Backup Subdirectory in the MYSQL directory

We need to replace the deleted files with the ones inside the backup subdirectory, which is located under this path:

C:\xampp\mysql

This is the folder we’re talking about:

In the backup subdirectory, you’re going to select and copy everything in there and only leave out the ibdata1 file. To be precise, don’t copy the ibdata1 file but copy everything else:

It’s important to note that the backup subdirectory we’re talking about is not the clone copy of the data subdirectory we made earlier. The backup subdirectory is part of the default XAMPP default directory structure.

Paste the copied files into the data subdirectory

Now, you need to go back to the data subdirectory under this path:

C:\xampp\mysql\data

Paste everything you’ve copied from the backup subdirectory.

Start the MYSQL Server

You can now start the MYSQL Server using the XAMPP Control Panel, and everything will normally without facing the error again

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.
 

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.