XAMPP MySQL 重启后无法启动

XAMPP MySQL won't start after rebooting

这在没有任何预警的情况下发生,我在数据库中注册的最后一件事是一个带有自动增量的列 属性。

这是错误日志:

2022-01-27 17:38:28 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-01-27 17:38:28 0 [Note] InnoDB: Uses event mutexes
2022-01-27 17:38:28 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-01-27 17:38:28 0 [Note] InnoDB: Number of pools: 1
2022-01-27 17:38:28 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-01-27 17:38:28 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-01-27 17:38:28 0 [Note] InnoDB: Completed initialization of buffer pool
2022-01-27 17:38:28 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-01-27 17:38:28 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-01-27 17:38:28 0 [Note] InnoDB: Setting file '\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-01-27 17:38:28 0 [Note] InnoDB: File '\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-01-27 17:38:28 0 [Note] InnoDB: Waiting for purge to start
2022-01-27 17:38:28 0 [Note] InnoDB: 10.4.22 started; log sequence number 809938; transaction id 1388
2022-01-27 17:38:28 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2022-01-27 17:38:28 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-01-27 17:38:28 0 [Note] Server socket created on IP: '::'.

我在 XAMPP 中收到此错误:

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

如果我不对它做任何其他修改,数据库会打开好几天,然后今天突然出现这个错误。

我通过从备份文件夹中复制 multi-master.info 来修复它,但如果有人有任何想法,我仍然想知道为什么首先会发生这种情况。

multi.master.info 为空。

将文件夹 mysql/data 重命名为 mysql/data_old(您可以使用任何名称)

新建文件夹mysql/data

将驻留在 mysql/backup 中的内容复制到新的 mysql/data 文件夹中

将 mysql/data_old 中的所有数据库文件夹复制到 mysql/data

最后从 mysql/data_old 复制 ibdata1 文件并将其替换到 mysql/data 文件夹

从 XAMPP 控制面板启动 MySQL