DEV Community

Cover image for How to Fix the XAMPP Error “MySQL Shutdown Unexpectedly”
Arslan Tariq
Arslan Tariq

Posted on

How to Fix the XAMPP Error “MySQL Shutdown Unexpectedly”

If you use a local development environment, you may run into problems that are similar to those on a live server. In some cases, your website or web application may be unable to connect with its database because MySQL isn’t running or it shut down unexpectedly.

Depending on which local environment you use, the process of troubleshooting your MySQL database might vary a bit. With XAMPP, the process is remarkably straightforward since you get access to a control panel instead of having to rely on the command line only.

What the XAMPP Error “MySQL Shutdown Unexpectedly” Is

Image description
Note
Caution! Don't delete ibdata1 file!

  1. Rename folder mysql/data to mysql/data_old
  2. Make a copy of mysql/backup folder and name it as mysql/data
  3. Copy all your database folders and mysql folder from mysql/data_old into mysql/data
  4. Copy mysql/data_old/ibdata1 file into mysql/data folder

Start MySQL from XAMPP Control Panel

XAMPP Fixed
Image description

Top comments (0)