How to Fix MySQL Not Starting in XAMPP? – Quick Steps

Is MySQL not working in XAMPP? Read this quick post to fix it.

It could be frustrating when MySQL stops working in your local development. Recently, I faced a similar issue while setting up a Magento store on my Windows computer. The error read “MySQL shutdown unexpectedly”.

MySQL not working in XAMPP 700x213

There could be various reasons why MySQL is not starting in XAMPP. One of which is a missing or corrupted file. In this post, I’m going to share the step-by-step method to resolve this issue by restoring the backup file.

The Solution to MySQL Not Starting in XAMPP

You can resolve the MySQL error in XAMPP by simply restoring the data from the backup. Here are the steps to do this:

First of all, stop any running services and close the XAMPP instance.

Navigate to the MySQL backup directory, e.g.:

C:xamppmysqlbackup

Select all files in the backup folder except for the ibdata1 file and copy them.

Go to the data directory in MySQL, i.e.:

C:xamppmysqldata

And paste the copied backup files.

That’s it — you’ve successfully restored the MySQL database. Now, open XAMPP and start the MySQL service and it will start working again.

I hope the database backup restore method will help you resolve MySQL startup problems in XAMPP. In case you need any further help or facing any issues, feel free to comment down.

Siddharth Nandava

Article by

Siddharth Nandava

Siddharth Nandava is an enthusiastic Jr Magento developer at Meetanshi. Apart from the work, you can find him learning new things and spending quality time with his family.