Error: MySQL shutdown unexpectedly.

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

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 15. August 2021 14:48

This is the output from apache_start.bat

Diese Eingabeforderung nicht waehrend des Running beenden
Bitte erst bei einem gewollten Shutdown schliessen
Please close this command only for Shutdown
Apache 2 is starting ...
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 15. August 2021 14:53

The post you linked to said to find the windows event log. I googled it and google said that it was the Event Viewer. I opened Event Viewer but I couldn't find any logs about XAMPP.
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby Altrea » 15. August 2021 15:12

you are mit jumping in topics and mixing information which doesn't help providing support.

the php_error_log was a completely different topic. It is okay that the file is empty. you will not need it for any Apache or MariaDB issue.

the Q&A is limited only for Apache issues. you said this issue was a typo and you solved it, so no need to do here any more.

you have a current issue with MariaDB/MySQL. you already know how to get information to debug this issue. you need to start MariaDB as console application.
Try to start MariaDB as console application in XAMPP Shell with the following command and tell us what it responses.
Code: Select all
mysqld --defaults-file=mysql\bin\my.ini --standalone --console
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: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 15. August 2021 15:38

I ran the command and this was the output:

Setting environment for using XAMPP for Windows.
makam@DESKTOP-UERKCNQ c:\xampp
# mysqld --defaults-file=mysql\bin\my.ini --standalone --console
2021-08-15 10:35:21 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.
2021-08-15 10:35:21 0 [Note] mysqld (mysqld 10.4.18-MariaDB) starting as process 4484 ...
InnoDB: using atomic writes.
2021-08-15 10:35:21 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2021-08-15 10:35:21 0 [Note] InnoDB: Uses event mutexes
2021-08-15 10:35:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-15 10:35:21 0 [Note] InnoDB: Number of pools: 1
2021-08-15 10:35:21 0 [Note] InnoDB: Using SSE2 crc32 instructions
2021-08-15 10:35:21 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2021-08-15 10:35:21 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-15 10:35:21 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-08-15 10:35:21 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-15 10:35:21 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-08-15 10:35:21 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2021-08-15 10:35:21 0 [Note] InnoDB: 10.4.18 started; log sequence number 314937; transaction id 381
2021-08-15 10:35:21 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2021-08-15 10:35:21 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-08-15 10:35:21 0 [Note] Server socket created on IP: '::'.
2021-08-15 10:35:21 0 [ERROR] mysqld: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-15 10:35:21 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-15 10:35:21 0 [ERROR] Aborting

makam@DESKTOP-UERKCNQ c:\xampp
#
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby Altrea » 15. August 2021 16:41

makamo66 wrote:2021-08-15 10:35:21 0 [ERROR] mysqld: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-15 10:35:21 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table '.\mysql\db' is marked as crashed and last (automatic?) repair failed
2021-08-15 10:35:21 0 [ERROR] Aborting

your mysql database needs to be repaired.

To do this please open the XAMPP Shell by clicking the Shell button in your XAMPP Control Panel and execute the following command:
Code: Select all
mysqld --console --skip-grant-tables --skip-external-locking


Leave this black command line window open and click on the Shell button in the Control Panel again to open a second command line window and execute this command:
Code: Select all
mysqlcheck -r --databases mysql --use-frm


After that you Can close both command line Windows and try to start mysql again normally from your XAMPP control panel
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: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 15. August 2021 16:48

Thanks, Altrea! That did the trick!
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 15. August 2021 18:07

Is there any way I can find out how I corrupted my database? I was working on edits that use the database when it happened and I'm afraid my code is at fault. Maybe I need to fix my code?
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby Nobbie » 15. August 2021 20:28

Actually, i dont think that this is your responsibility. We do have so many many request for corrupted database, for me it seems to be a Windows based issue. Whatever it is - but there no such thing in Linux installations. We have tons of requests for corrupted databases under WIndows, we have literrally NONE(!) for Linux.

So far so good. And of course: i recommend to use Linux instead of Windows. Especially if you are running a webserver. Its on you to follow my advice or not, but i am pretty sure, you wont have such things in a Linux environment. We dont know the reason for that behaviour, but we do know, that they are based on Windows. Its on you to take care.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Error: MySQL shutdown unexpectedly.

Postby Altrea » 15. August 2021 21:00

Nobbie wrote:We do have so many many request for corrupted database, for me it seems to be a Windows based issue.

For me it is more than that. It seems to be limited to XAMPP too. For Example i have never heard of such problems in WampServer which also uses MariaDB 10.4.
I also have a MariaDB 10.6 standalone live server running for two months now, without any issies.

So i still think it must have something to do with the way Bitnami is building the database for new versions, or the XAMPP MariaDB configuration, or the way XAMPP is stopping the MariaDB Daemon.
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: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Error: MySQL shutdown unexpectedly.

Postby JJ_Tagy » 17. August 2021 20:16

Altrea wrote:the way XAMPP is stopping the MariaDB Daemon

This is the problem spot as far as I can tell. I’ve never had crashes if I could stop the server properly (mysqladmin shutdown)
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 31. March 2024 01:34

It's now March 2024 and I came back to this forum thread because I had the same problem again. I was able to fix it again using the input from Altrea. I really should change to Linux so I don't have this kind of problem all the time. Thanks Altrea!
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby Nobbie » 31. March 2024 13:00

makamo66 wrote:I really should change to Linux


Yes, I can only encourage you to give it a try! I can recommend that you install Linux Mint Cinnamon, which is not visually light years away from Windows, but your problems will disappear and you don't have to be afraid of them.

I know that many people believe that they cannot use Linux. Funnily enough, the same people think macOS is the easiest OS in the world to use. But macOS is based on Unix/Linux and has much more similarities to Linux than to Windows.

After all, Apache & Co. are also developed under Linux and most web servers in the world run under Linux. I said goodbye to Windows a long time ago and don't miss anything. On the contrary: no more annoying "Please don't turn off the computer..." screens when starting up or shutting down and the computer counts agonizingly slowly to 100% until the forced update is finally completed.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 31. March 2024 18:10

Ideally I would like to create a dual partition with Linux and Windows but I only have 150 Gigabyte left of storage on my hard drive and I don't think that's enough.
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Re: Error: MySQL shutdown unexpectedly.

Postby Nobbie » 31. March 2024 21:55

150GB is a lot more than you need for a linux installation. That requires way less than 32GB.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04

Re: Error: MySQL shutdown unexpectedly.

Postby makamo66 » 31. March 2024 23:02

But it's not just the installation I'm thinking about. It's all the apps that I would need to install both on Windows and on Linux.
User avatar
makamo66
 
Posts: 19
Joined: 14. August 2021 00:31
XAMPP version: 7.4.16
Operating System: Windows 10 Home 64-bit OS

Previous

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 215 guests