MySQL shutdown unexpectedly – Attempts to repair the databas

Problems with the Windows version of XAMPP, questions, comments, and anything related.

MySQL shutdown unexpectedly – Attempts to repair the databas

Postby klaus100 » 12. April 2022 10:33

Dear Altrea,

because I think that my problem is very similar to those of George1109 » 24. January 2021 21:18,
See
https://community.apachefriends.org/f/viewtopic.php?f=16&t=80337
I tried to repair the database according to your recommendations for George1109.

But from the beginning:
I obtained the following message (in German language):
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

Log file:
Cannot find checkpoint record at LSN (1,0x7ad7)
2022-04-12 10:52:23 0 [ERROR] mysqld.exe: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
2022-04-12 10:52:23 0 [ERROR] Plugin 'Aria' init function returned error.
2022-04-12 10:52:23 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2022-04-12 10:52:23 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-04-12 10:52:23 0 [Note] InnoDB: Uses event mutexes
2022-04-12 10:52:23 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-04-12 10:52:23 0 [Note] InnoDB: Number of pools: 1
2022-04-12 10:52:23 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-04-12 10:52:23 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-04-12 10:52:23 0 [Note] InnoDB: Completed initialization of buffer pool
2022-04-12 10:52:23 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-04-12 10:52:23 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-04-12 10:52:23 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-04-12 10:52:23 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-04-12 10:52:23 0 [Note] InnoDB: Waiting for purge to start
2022-04-12 10:52:23 0 [Note] InnoDB: 10.4.22 started; log sequence number 1703188671; transaction id 920637
2022-04-12 10:52:23 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2022-04-12 10:52:23 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-04-12 10:52:23 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2022-04-12 10:52:23 0 [ERROR] Failed to initialize plugins.
2022-04-12 10:52:23 0 [ERROR] Aborting


Attempt 1 in shell – text in shell:
# CODE: SELECT ALL
Der Befehl "CODE:" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
In English:
The command “CODE:” is either misspelled or Couldn’t be found.



[XY]@DESKTOP-KQFO2RN c:\xampp
# mysqld --console --skip-grant-tables --skip-external-locking
2022-04-12 10:54:27 0 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead.
2022-04-12 10:54:27 0 [Note] mysqld (mysqld 10.4.22-MariaDB) starting as process 4292 ...
Cannot find checkpoint record at LSN (1,0x7ad7)
2022-04-12 10:54:27 0 [ERROR] mysqld: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
2022-04-12 10:54:27 0 [ERROR] Plugin 'Aria' init function returned error.
2022-04-12 10:54:27 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2022-04-12 10:54:27 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-04-12 10:54:27 0 [Note] InnoDB: Uses event mutexes
2022-04-12 10:54:27 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-04-12 10:54:27 0 [Note] InnoDB: Number of pools: 1
2022-04-12 10:54:27 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-04-12 10:54:27 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-04-12 10:54:27 0 [Note] InnoDB: Completed initialization of buffer pool
2022-04-12 10:54:27 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-04-12 10:54:27 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-04-12 10:54:27 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-04-12 10:54:27 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-04-12 10:54:27 0 [Note] InnoDB: Waiting for purge to start
2022-04-12 10:54:27 0 [Note] InnoDB: 10.4.22 started; log sequence number 1703188680; transaction id 920637
2022-04-12 10:54:27 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2022-04-12 10:54:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-04-12 10:54:27 0 [ERROR] Failed to initialize plugins.
2022-04-12 10:54:27 0 [ERROR] Aborting

Due to that message I did not use:
CODE: SELECT ALL
mysqlcheck -r --databases mysql --use-frm

Attempt 2:
I changed the name of two directories:
Directory data in dataold
Directory backup in data
Effect: MySQL is starting in the XAMPP Control Panel and no messages like MySQL shutdown unexpectedly etc.
But this approach hast he disadvantage that there is no database and therefore no tables available.
My target: To use the latest content of the databse
klaus100
 
Posts: 9
Joined: 12. April 2022 10:24
XAMPP version: 3.3.0
Operating System: Operating System: win10

Re: MySQL shutdown unexpectedly – Solution - problem solved

Postby klaus100 » 14. April 2022 11:38

Although I cannot guarantee, that the following solution helps in each case, I want to reveal this solution. And because it is a small effort to solve the problem:
I changed only the names of some files in folder \xampp\mysql\

I had two files ib_logfile0 with different time stamps. May be therefore XAMPP was confused?
ib_logfile0 to ib_logfile0old
ib_logfile0 to ib_logfile0old


I had two files aria_log_control with different time stamps. May be therefore XAMPP was confused?
aria_log_control to aria_log_controloldold
aria_log_control to aria_log_controloldold

I did not touch File ib_logfile1.

May be I had these files double, because XAMPP was not finished properly. In the past.
Wehn I wanted finish regulary XAMPP i obtained the messsage:
Cannot create file.
C:\\xampp\xampp-control-ini – No access (in German: Zugriff verweigert)

Before I changed the names of the above mentioned files, I solved this problem according to that solution.

https://community.apachefriends.org/f/viewtopic.php?f=4&t=79343&p=269238&hilit=Klick+auf+Beenden#p269238

I am not shure if, there is any causal relationship between „Cannot create file“ and „MySQL shutdown unexpectedly“.
But I can recommend to check the following:
How many ib_logfile0-files do you have in folder \xampp\mysql\data\?
How many aria_log_control do you have in folder \xampp\mysql\?


After succesfully logged in my localhost by using XAMPP:
I have a new ib_logfile0-file and a new aria_log_control-file: Each file only once.
klaus100
 
Posts: 9
Joined: 12. April 2022 10:24
XAMPP version: 3.3.0
Operating System: Operating System: win10

too soon happy.

Postby klaus100 » 15. April 2022 07:48

I was too soon happy.
The solution only worked once. Next time I called the Control Panel, the message “MySQL shutdown unexpectedly” came again.

If you somehow manage to log into the local host again, you should make a backup immediately.

And reinstall Xampp?

At least I got rid of the message “cannot create file. ”
klaus100
 
Posts: 9
Joined: 12. April 2022 10:24
XAMPP version: 3.3.0
Operating System: Operating System: win10

[Solved] MySQL shutdown unexpectedly

Postby klaus100 » 15. April 2022 11:31

Because there is no sustainable solution visible, I installed XAMPP und WordPress new as localhost.
Secondly I imported my Backup (Duplicator) into the new Installation.
No Problems with the imported database from the old XAMPP visible by 3 attempts.
Beause I could not find xampp-controll.ini in the new version from XAMPP, I have always to call the control panel as a administrator. To avoid message „cannot create file“ when finishing Control Panel“.

With the following approach, I could log in my old localhost once, to make a backup with Duplicator.
Shell
First run:
CODE: SELECT ALL
mysqld --console --skip-grant-tables --skip-external-locking
Part of the protocol:
mysqld: Aria recovery failed. Please run aria_chk -r on all Aria tables and delete all aria_log.######## files
I did not use aria_chk -r on.
But I changed the names für all aria_log files. Here the results:
aria_log_controlold
aria_logold.00000001
I did not touch the files:
ib_logfile0
ib_logfile1

Second run:
CODE: SELECT ALL
mysqld --console --skip-grant-tables --skip-external-locking


Part of the protocol:
mysqld: ready for connections.

I have now 2 new files:
aria_log_control
aria_log.00000002


I could login in localhost.
I made a backup (with duplicator).
Afterwards:
Logged out loclahost.
I finished control panel.
I closed Shell window.
I shut down the PC.
I started the PC.
I called the Control Panel.
Again Message: MySQL shutdown unexpectedly

Again Shell:
Shell
CODE: SELECT ALL
mysqld --console --skip-grant-tables --skip-external-locking
Part of the protocol:
Again Part of the protocol:
mysqld: ready for connections.


This means, that for every calling the Control Panel, I have to use the shell.with the command above This is not a sustainable solution!
klaus100
 
Posts: 9
Joined: 12. April 2022 10:24
XAMPP version: 3.3.0
Operating System: Operating System: win10

Re: MySQL shutdown unexpectedly – Attempts to repair the dat

Postby legendary1 » 16. April 2022 05:56

This is what has worked for me.

1. It is a link to StackOverflow, subject "How to solve "Error: MySQL shutdown unexpectedly"?"
https://stackoverflow.com/questions/18022809/how-to-solve-error-mysql-shutdown-unexpectedly

2. I also get less of that error when open XAMPP as an administrator.

3. Also, when I download XAMPP, I did not download the Bitnami for WordPress module. I find that I have a lot less database errors without it.

4. I removed PHP 8.1.x because a lot of my applications were not compatible with it and I kept getting random crashes. Maybe I should say, I uninstalled XAMPP 8.1.x and reinstalled 8.0.x.
legendary1
 
Posts: 2
Joined: 16. April 2022 05:07
XAMPP version: 8.0.15
Operating System: Windows 11

Re: MySQL shutdown unexpectedly – Attempts to repair the dat

Postby Froosh » 29. April 2022 13:29

I had the database fail to start a number of times in the past. Using information linked in this thread (https://community.apachefriends.org/f/viewtopic.php?f=16&t=81878#p276040) I was able to repair the MySQL. It would work fine for a number of days, and then I'd have the same error.

What has now worked for about the past month is to configure MySQL and Apache to run as Windows Services. I configured the services so that I have to start them manually, as I do not always need them running. This way I can launch the XAMPP Control Panel and start the services, MySQL followed by Apache (not sure if that matters). I am guessing there is a race condition, or something of that nature, when MySQL is run as a regular process from the control panel, just a guess.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro

Re: MySQL shutdown unexpectedly – Attempts to repair the dat

Postby Altrea » 29. April 2022 13:38

Froosh wrote:This way I can launch the XAMPP Control Panel and start the services, MySQL followed by Apache (not sure if that matters). I am guessing there is a race condition, or something of that nature, when MySQL is run as a regular process from the control panel, just a guess.

no race conditions here. You can start Apache and MySQL/MariaDB in any Order.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: MySQL shutdown unexpectedly – Attempts to repair the dat

Postby Froosh » 29. April 2022 14:04

Thank you for the clarification. For the race condition, I was more thinking of when not running MySQL/Apache as Windows Services. Running them as services has worked reliably for me. Before that, I had frequent issues with MySQL not starting.
User avatar
Froosh
 
Posts: 138
Joined: 27. March 2022 17:56
XAMPP version: 8.2.0
Operating System: Windows 11 Pro


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 187 guests