在Windows 10计算机上的XAMPP安装中,MySQL服务将不再启动。 XAMPP控制台中的错误消息显示:
错误:MySQL意外关闭。 这可能是由于端口阻塞,缺少依赖项,特权不当,崩溃或其他方法关闭导致的。
错误日志显示如下:
InnoDB: using atomic writes.
2019-10-14 20:43:47 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-10-14 20:43:47 0 [Note] InnoDB: Uses event mutexes
2019-10-14 20:43:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-10-14 20:43:47 0 [Note] InnoDB: Number of pools: 1
2019-10-14 20:43:47 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-10-14 20:43:47 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-10-14 20:43:47 0 [Note] InnoDB: Completed initialization of buffer pool
2019-10-14 20:43:48 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-10-14 20:43:48 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-10-14 20:43:48 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-10-14 20:43:48 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-10-14 20:43:48 0 [Note] InnoDB: 10.4.6 started; log sequence number 6899920; transaction id 13408
2019-10-14 20:43:48 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2019-10-14 20:43:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-10-14 20:43:48 0 [Note] Server socket created on IP: '::'.
Windows事件查看器包含5条单独的错误消息:
mysqld.exe: Table '.\mysql\db' is marked as crashed and should be repaired
mysqld.exe: Index for table '.\mysql\db' is corrupt; try to repair it
Couldn't repair table: mysql.db
Fatal error: Can't open and lock privilege tables: Index for table 'db' is corrupt; try to repair it
Aborting
尝试连接到MySQL时,它不起作用(这很有意义,因为MySQL服务将无法运行)。这是尝试连接ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)
后在CMD中给出的错误消息。
与需要修复的MySQL表相关的帖子需要连接到MySQL,因此在这种情况下无济于事。如果可以在Windows 10计算机上修复mysql.db
而无需连接MySQL,该怎么做?
答案 0 :(得分:10)
这对我有帮助:
从控制面板打开外壳,并使用以下命令启动mysql:
mysqld –-console –-skip-grant-tables –-skip-external-locking
从控制面板打开另一个外壳,并使用以下命令修复数据库:
mysqlcheck -r --databases mysql --use-frm
停止mysql,关闭外壳并正常重启mysql。
发布在以下位置: https://stackoverflow.com/a/57001732