mysqld.exe:表'.\mysql\db'被标记为崩溃,应该修复 [英] mysqld.exe: Table '.\mysql\db' is marked as crashed and should be repaired

查看:24
本文介绍了mysqld.exe:表'.\mysql\db'被标记为崩溃,应该修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQL 服务将不再在我的 Windows 10 机器上的 XAMPP 安装上启动.XAMPP 控制台中的错误消息说:

The MySQL service will no longer start on my XAMPP installation on a Windows 10 machine. The error message in the XAMPP console says:

错误:MySQL 意外关闭.这可能是由于端口被阻止、缺少依赖项、权限不当、崩溃或被其他方法关闭.

Error: MySQL shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method.

错误日志显示:

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 个单独的错误消息:

And the Windows Event Viewer contains 5 separate error messages:

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).

When an attempt is made to connect to MySQL, it doesn't work (which makes sense because the MySQL service will not run). This is the error message given in CMD after an attempt is made to connect: ERROR 2002 (HY000): Can't connect to MySQL server on 'localhost' (10061).

与需要修复的 MySQL 表相关的帖子需要连接到 MySQL,因此在这种情况下它们无济于事.如果可以在不连接 MySQL 的情况下在 Windows 10 机器上修复 mysql.db,这样做的步骤是什么?

Posts related to MySQL tables that need to be repaired require connecting to MySQL so they do not help in this situation. If it's possible to repair mysql.db on a Windows 10 machine without connecting to MySQL, what are the steps to do so?

推荐答案

这个对我有帮助:

This one helped for me:

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

Open shell from from control panel and start mysql with this command:

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

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

Open another shell from control panel and repair database with this command:

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

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

Stop mysql, close shells and restart mysql normally.

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

这篇关于mysqld.exe:表'.\mysql\db'被标记为崩溃,应该修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆