Error: MySQL shutdown unexpectedly

XAMMP and Windows 11

Recently I’ve encountered some issues with my local MySQL installation becoming corrupt and not starting.

Xampp Control Panel v3.3.0 with Windows 11 may be causing the MySQL installation to intermittently be corrupted. In my experience, as a result of the computer going to sleep, or being shut down, without first closing and stopping service in Xampp (which isn’t always possible to do).

You may get the following error:

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

Several reports of the issue exist, for example at the XAMPP for Windows Apache Friends forum.

The logs may give you more information about the issue, but in several examples of when it happened to me, the logs didn’t point to the cause or how to fix the issue, and in several examples, the logs were different. You might see your logs show something like:

2023-03-31 10:34:14 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-03-31 10:34:14 0 [Note] InnoDB: Uses event mutexes
2023-03-31 10:34:14 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-03-31 10:34:14 0 [Note] InnoDB: Number of pools: 1
2023-03-31 10:34:14 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-03-31 10:34:14 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-03-31 10:34:14 0 [Note] InnoDB: Completed initialization of buffer pool
2023-03-31 10:34:14 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=649324
2023-03-31 10:34:14 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2023-03-31 10:34:14 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-03-31 10:34:14 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-03-31 10:34:14 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-03-31 10:34:14 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2023-03-31 10:34:14 0 [Note] InnoDB: Waiting for purge to start
2023-03-31 10:34:14 0 [Note] InnoDB: 10.4.27 started; log sequence number 649333; transaction id 291
2023-03-31 10:34:14 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2023-03-31 10:34:14 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-03-31 10:34:14 0 [Note] Server socket created on IP: '::'.

As of writing no solutions are in place from the team. While some docs may point in the direction of making sure that nothing is using the same port as mysql – as the initial error suggests – this is not related to the errors me and other are encountering.

Fix

But you can do the following:

  1. Navigate to your XAMPP MySQL directory (C:\xampp\mysql).
  2. Create a new folder called DATA_BROKEN and copy
    • C:\xampp\mysql\backup and
    • C:\xampp\mysql\data
    • into this folder.
  3. Then, copy and paste the contents of C:\xampp\mysql\backup into C:\xampp\mysql\data, overwriting all the files. Note the dates may be older that your most recent activity. When prompted, choose to overwrite the existing files
  4. Then, go into C:\xampp\mysql\DATA_BROKEN \data, and copy the ibdata1 file from there, and paste it into C:\xampp\mysql\data overwriting the file.
  5. Then start MySQL. Your databases, tables, and data should all be available, just like before.
4.5 4 votes
Rating
Subscribe
Notify of
guest
8 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Juan Manuel Carrillo Campos
Juan Manuel Carrillo Campos
1 year ago

Thank you very much!
This tip helped me to fix exactly “this problem” (“yesterday” was working, “today” don’t start!) with the MySQL installation!
Now I’ll take care to stop the server before shuting down my device!
I already took note of the tip!

R
R
1 year ago

Very welcome, I’m glad it helped someone, very frustrating issue

yann kenneth
yann kenneth
6 months ago

J’ai essayĆ© mais l’erreur persiste

MIhail
MIhail
3 months ago
Reply to  admin

can we go on a call or something so u can help me easier; pls

Sarvesh
Sarvesh
4 months ago

13:29:06 [mysql] Error: MySQL shutdown unexpectedly.
13:29:06 [mysql] This may be due to a blocked port, missing dependencies,
13:29:06 [mysql] improper privileges, a crash, or a shutdown by another method.
13:29:06 [mysql] Press the Logs button to view error logs and check
13:29:06 [mysql] the Windows Event Viewer for more clues
13:29:06 [mysql] If you need more help, copy and post this
13:29:06 [mysql] entire log window on the forums
i tried all the steps but i can’t fix my issue please help me . emergency!!!!!!!!!!!!!!!!!

Yev
Yev
2 months ago

Yep, that solved my issue too… So strange


8
0
Would love your thoughts, please comment.x
()
x