Error: MySQL shutdown unexpectedly

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

Error: MySQL shutdown unexpectedly

Postby natsocky » 07. October 2023 17:00

MySQL has been fine for weeks, though when I tried to start it today I keep getting an error. My friend and I have tried troubleshooting though nothing seems to work. Apache boots fine.

I have tried changing ports on the mysql config but that didn't work.
I have tried uninstalling an reinstalling
I have checked that the port isn't being used elsewhere (which it is not)

Any help would be greatly appreciated!

--------------------------
16:54:35 [mysql] Error: MySQL shutdown unexpectedly.
16:54:35 [mysql] This may be due to a blocked port, missing dependencies,
16:54:35 [mysql] improper privileges, a crash, or a shutdown by another method.
16:54:35 [mysql] Press the Logs button to view error logs and check
16:54:35 [mysql] the Windows Event Viewer for more clues
16:54:35 [mysql] If you need more help, copy and post this
16:54:35 [mysql] entire log window on the forums
---------------------------
LOGS:
2023-10-07 16:54:34 0 [Note] Starting MariaDB 10.4.28-MariaDB source revision c8f2e9a5c0ac5905f28b050b7df5a9ffd914b7e7 as process 25276
2023-10-07 16:54:34 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2023-10-07 16:54:34 0 [Note] InnoDB: Uses event mutexes
2023-10-07 16:54:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-10-07 16:54:34 0 [Note] InnoDB: Number of pools: 1
2023-10-07 16:54:34 0 [Note] InnoDB: Using SSE2 crc32 instructions
2023-10-07 16:54:34 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2023-10-07 16:54:34 0 [Note] InnoDB: Completed initialization of buffer pool
2023-10-07 16:54:34 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=300288
2023-10-07 16:54:34 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2023-10-07 16:54:34 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2023-10-07 16:54:34 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-10-07 16:54:34 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-10-07 16:54:34 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2023-10-07 16:54:34 0 [Note] InnoDB: Waiting for purge to start
2023-10-07 16:54:35 0 [Note] InnoDB: 10.4.28 started; log sequence number 300297; transaction id 170
2023-10-07 16:54:35 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2023-10-07 16:54:35 0 [Note] Plugin 'FEEDBACK' is disabled.
2023-10-07 16:54:35 0 [Note] Server socket created on IP: '::'.
2023-10-07 16:54:35 0 [Note] InnoDB: Buffer pool(s) load completed at 231007 16:54:35
natsocky
 
Posts: 1
Joined: 07. October 2023 16:56
XAMPP version: 3.3.0
Operating System: Windows

Re: Error: MySQL shutdown unexpectedly

Postby njenga@gmail.com » 08. November 2023 04:19

Try this:

IMPORTANT: do NOT delete ibdata1 file. You could destroy all your databases!!

    Rename folder mysql/data to mysql/data_old (delet exising data_old)
    Make a copy of mysql/backup folder and name it as mysql/data
    Copy all your database folders from mysql/data_old into mysql/data (except mysql, performance_schema, and phpmyadmin folders)
    Copy mysql/data_old/ibdata1 file into mysql/data folder
    Start MySQL from XAMPP control panel
njenga@gmail.com
 
Posts: 1
Joined: 08. November 2023 04:14
XAMPP version: 8.2.4
Operating System: Windows 11

Re: Error: MySQL shutdown unexpectedly

Postby sysmai » 08. November 2023 20:00

I had the exact same issue. Came out of nowhere starting yesterday 11/7 until today 11/8.

Using the backup and transferring the specified files and folders fixed my issue. Thank you.
sysmai
 
Posts: 1
Joined: 08. November 2023 19:58
XAMPP version: 8.2.4
Operating System: Windows 11 Home

Re: Error: MySQL shutdown unexpectedly

Postby JohnN » 13. November 2023 05:34

Same issue here. Has been fine for years now just fails. Spinning my wheels for hours and it seems I'm not the only one. What's really going on here? Windows 11.
JohnN
 
Posts: 1
Joined: 13. November 2023 05:26
XAMPP version: 8.1.2
Operating System: Windows 11

Re: Error: MySQL shutdown unexpectedly

Postby amiens80 » 13. November 2023 10:41

hi,

i have the same issue today 13 nov 2023, i'm in win10 x64 and i don't apply any windows update this morning or yesterday.
i tried to restore a full mysql folder from 9/nov before the issue, and when i start , the same problem happen.

i check the port with netsate, 3306 remain free.
i try to recover the backup but i have the same issue.
i try to run with "admin" privilege, same issue.

in windows event, i have this strange errors since this morning on maria db : (each line is an event)

Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--log-basename=#' or '--relay-log=mysql-relay-bin' to avoid this problem.

Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593

Failed to open the relay log '.\mysql-relay-bin-2023@002d08@002d25@0020@00209@003a18@003a16@00200@0020@005bnote@005d@0020added@0020new@0020master_info@0020@0027@0027@0020to@0020hash@0020table@000d.000001' (relay_log_pos 4)

Could not find target log during relay log initialization

Initialized Master_info from 'master-2023@002d08@002d25@0020@00209@003a18@003a16@00200@0020@005bnote@005d@0020added@0020new@0020master_info@0020@0027@0027@0020to@0020hash@0020table@000d.info' failed

Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593

Reading of some Master_info entries failed

Failed to initialize multi master structures

Aborting


i'm not an expert, but is the long-file name for the lof file the main problem ?
"mysql-relay-bin-2023@002d08@002d25@0020@00209@003a18@003a16@00200@0020@005bnote@005d@0020added@0020new@0020master_info@0020@0027@0027@0020to@0020hash@0020table@000d.000001" is very lonf name for a file on windows (nfts structure) isn't it ?

in my mysql data folder, i have a lot of that long files name, look at that :
https://ibb.co/Q8gCY2t
Image

Any idea of the issue ?
amiens80
 
Posts: 8
Joined: 02. December 2021 10:22
XAMPP version: 3.2.4
Operating System: win10 x64

Re: Error: MySQL shutdown unexpectedly

Postby amiens80 » 13. November 2023 11:20

well,

i added some info for my case.

Restoring the cold folder backup from 9nov (2day before the issue) did not solve the issue
but
restoring the 6nov folder looks to solve (or avoid) the issue.
i can start mysql, no log error.
i checked table & analyse of tables in phpmyadmin : no error

but i still have this error in the windows10 log event (whereas mysql .log did not have error at all!!!):

Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--log-basename=#' or '--relay-log=mysql-relay-bin' to avoid this problem.
Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593
Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593
Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593
Slave I/O: Fatal error: Invalid (empty) username when attempting to connect to the master server. Connection attempt terminated. Internal MariaDB error code: 1593


And i still have this long file name in the data folder whereas it's working
Image


I'll come back tomorrrow for follow other issue....
bye
amiens80
 
Posts: 8
Joined: 02. December 2021 10:22
XAMPP version: 3.2.4
Operating System: win10 x64

Re: Error: MySQL shutdown unexpectedly

Postby Altrea » 13. November 2023 12:10

Hi amiens80,

Thanks for providing detailed debug information.
I call this the multi-master error. Your MariaDB thinks it is running in master replicant setting.

Please try the following fix. It already helped lots of users solving the multi-master Problem:

  • Open your folder "\xampp\mysql\data"
  • Delete the file "multi-master.info"
  • Delete all files beginning with "master-"
  • Delete all files beginning with "mysql_relay-bin-"
  • Delete all files beginning with "relay-log-"

Now try to start mariadb the normal way again.

best wishes,
Altrea
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


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 223 guests