我正在使用 xampp ,每次启动 mysql 时,都会在 xampp 中出现以下错误
Error: MySQL shutdown unexpectedly.
13:16:14 [mysql] This may be due to a blocked port, missing dependencies,
13:16:14 [mysql] improper privileges, a crash, or a shutdown by another method.
13:16:14 [mysql] Press the Logs button to view error logs and check
Run Code Online (Sandbox Code Playgroud)
我检查了错误日志,下面是输出,我什至更改了端口,但这没有帮助。以前我通过查看其他一些 stackoverflow 答案删除了 ibdata 并且整个数据库都丢失了,所以不想犯那个错误。任何安全指南修复这个错误?
2019-08-07 13:16:01 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-08-07 13:16:01 0 [Note] InnoDB: Uses event mutexes
2019-08-07 13:16:01 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-08-07 13:16:01 0 [Note] InnoDB: Number of pools: 1
2019-08-07 13:16:01 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-08-07 13:16:01 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-08-07 13:16:01 0 [Note] InnoDB: Completed initialization of buffer pool
2019-08-07 13:16:01 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-08-07 13:16:01 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-08-07 13:16:01 0 [Note] InnoDB: Setting file 'D:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-08-07 13:16:01 0 [Note] InnoDB: File 'D:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-08-07 13:16:01 0 [Note] InnoDB: Waiting for purge to start
2019-08-07 13:16:01 0 [Note] InnoDB: 10.3.16 started; log sequence number 1951328; transaction id 1068
2019-08-07 13:16:01 0 [Note] InnoDB: Loading buffer pool(s) from D:\xampp\mysql\data\ib_buffer_pool
2019-08-07 13:16:01 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-08-07 13:16:01 0 [Note] Server socket created on IP: '::'.
2019-08-07 13:16:01 0 [Note] InnoDB: Buffer pool(s) load completed at 190807 13:16:01
Run Code Online (Sandbox Code Playgroud)
我在 Windows 事件中收到以下错误
The description for Event ID 100 from source MySQL cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Slave I/O: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist in engine, Internal MariaDB error code: 1932
Run Code Online (Sandbox Code Playgroud)
Clo*_*omp 11
如果您想要一种更快更简单的方法来解决此问题,而不是重新安装 XAMPP 并重新配置所有内容,请在 /xampp/mysql/data/ 文件夹中查找具有这些前缀和非常长的文件名的任何文件。它们的文件名中几乎都有大量重复的“@”符号,如下所示:
master-...@...@...@..@...
multi-...@...@...@..@...
mysql-relay-bin-...@...@...@..@...
relay-log-...@...@...@..@...
Run Code Online (Sandbox Code Playgroud)
如果您找到这些文件(不是标准的短表名称,而是崩溃转储文件),则创建一个 /backup 文件夹并只需将它们移动到该文件夹中。然后你可以通过XAMPP控制面板重新启动MySQL,而不会失败。这是一个简单快速的修复方法,我刚刚发现并用来解决同样的问题!
附录: 7-24-2022 如果删除这些文件后 MySQL 无法启动,则也删除此文件:
multi-master.info
Run Code Online (Sandbox Code Playgroud)
然后 MySQL 应该启动,并且在 XAMPP 中保持正常运行。
一个简单有效的解决方案是: