- 17.20.1 解决 InnoDB I/O 问题17.20.1 Troubleshooting InnoDB I/O Problems
- 17.20.2 解决恢复失败17.20.2 Troubleshooting Recovery Failures
- 17.20.3 强制 InnoDB 恢复17.20.3 Forcing InnoDB Recovery
- 17.20.4 InnoDB 数据字典操作故障排除17.20.4 Troubleshooting InnoDB Data Dictionary Operations
- 17.20.5 InnoDB 错误处理17.20.5 InnoDB Error Handling
以下通用指南适用于排查 InnoDB 的问题:The following general guidelines apply to troubleshooting
InnoDB problems:
当操作失败或您怀疑存在错误时,请查看 MySQL 服务器错误日志(参见 第 7.4.2 节,“错误日志”)。服务器错误信息参考 提供了一些常见
InnoDB特定错误的故障排除信息。When an operation fails or you suspect a bug, look at the MySQL server error log (see Section 7.4.2, “The Error Log”). Server Error Message Reference provides troubleshooting information for some of the commonInnoDB-specific errors that you may encounter.如果故障与死锁有关,请启用
innodb_print_all_deadlocks选项运行,以便将每个死锁的详细信息打印到 MySQL 服务器错误日志中。有关死锁的信息,请参阅第 17.7.5 节,“InnoDB 中的死锁”。If the failure is related to a deadlock, run with theinnodb_print_all_deadlocksoption enabled so that details about each deadlock are printed to the MySQL server error log. For information about deadlocks, see Section 17.7.5, “Deadlocks in InnoDB”.如果问题与
InnoDB数据字典有关,请参阅第 17.20.4 节,“排查 InnoDB 数据字典操作问题”。If the issue is related to theInnoDBdata dictionary, see Section 17.20.4, “Troubleshooting InnoDB Data Dictionary Operations”.在进行故障排除时,通常最好从命令提示符运行 MySQL 服务器,而不是通过 mysqld_safe 或作为 Windows 服务运行。这样,你就可以看到 mysqld 在控制台上输出的内容,从而更好地了解发生了什么。在 Windows 上,可以使用 mysqld 并加上
--console选项来将输出定向到控制台窗口。When troubleshooting, it is usually best to run the MySQL server from the command prompt, rather than through mysqld_safe or as a Windows service. You can then see what mysqld prints to the console, and so have a better grasp of what is going on. On Windows, start mysqld with the--consoleoption to direct the output to the console window.启用
InnoDB监视器以获取问题信息(参见 第 17.17 节,“InnoDB 监视器”)。如果问题与性能相关,或者您的服务器似乎挂起,您应该启用标准监视器以打印InnoDB的内部状态信息。如果问题与锁相关,请启用锁监视器。如果问题与表创建、表空间或数据字典操作相关,请参考 InnoDB 信息架构系统表 检查InnoDB内部数据字典的内容。 Enable theInnoDBMonitors to obtain information about a problem (see Section 17.17, “InnoDB Monitors”). If the problem is performance-related, or your server appears to be hung, you should enable the standard Monitor to print information about the internal state ofInnoDB. If the problem is with locks, enable the Lock Monitor. If the problem is with table creation, tablespaces, or data dictionary operations, refer to the InnoDB Information Schema system tables to examine contents of theInnoDBinternal data dictionary.InnoDB会在以下情况下临时启用标准InnoDB监控输出:InnoDBtemporarily enables standardInnoDBMonitor output under the following conditions:长时间的信号量等待A long semaphore wait
InnoDB在缓冲池中找不到空闲块InnoDBcannot find free blocks in the buffer pool缓冲池中超过 67% 的空间被锁堆或自适应哈希索引占用Over 67% of the buffer pool is occupied by lock heaps or the adaptive hash index
如果怀疑某个表已损坏,请对该表运行
CHECK TABLE。If you suspect that a table is corrupt, runCHECK TABLEon that table.