【问题标题】:mysqld.exe: Table '.\mysql\db' is marked as crashed and should be repairedmysqld.exe:表'.\mysql\db'被标记为崩溃,应该修复
【发布时间】:2020-02-11 15:17:12
【问题描述】:

MySQL 服务将不再在我在 Windows 10 机器上安装的 XAMPP 上启动。 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 服务不会运行)。这是尝试连接后 CMD 中给出的错误消息:ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061)

与需要修复的 MySQL 表相关的帖子需要连接到 MySQL,因此它们在这种情况下没有帮助。如果可以在不连接 MySQL 的情况下在 Windows 10 机器上修复 mysql.db,具体步骤是什么?

【问题讨论】:

标签: mysql


【解决方案1】:

这个对我有帮助:

从控制面板打开 shell 并使用以下命令启动 mysql:

mysqld –-console –-skip-grant-tables –-skip-external-locking

从控制面板打开另一个shell并使用以下命令修复数据库:

mysqlcheck -r --databases mysql --use-frm

停止mysql,关闭shell并正常重启mysql。

发表于以下: https://stackoverflow.com/a/57001732

【讨论】:

  • 救命! :-)
猜你喜欢
  • 2019-12-30
  • 2015-09-17
  • 2011-05-20
  • 2013-05-30
  • 1970-01-01
  • 2012-08-05
  • 2023-01-23
相关资源
最近更新 更多