排查 InnoDB I/O 问题的步骤取决于问题发生的时间:是在 MySQL 服务器启动期间,还是在 DML 或 DDL 语句由于文件系统级别问题失败期间的正常操作中。The troubleshooting steps for InnoDB I/O
problems depend on when the problem occurs: during startup of the
MySQL server, or during normal operations when a DML or DDL
statement fails due to problems at the file system level.
初始化问题Initialization Problems
如果在 InnoDB 尝试初始化其表空间或日志文件时出现问题,请删除 InnoDB 创建的所有文件:所有 ibdata 文件和所有重做日志文件 (#ib_redo 文件)。如果您创建了任何 NInnoDB 表,也请从 MySQL 数据库目录中删除任何 .ibd 文件。然后再次尝试初始化 InnoDB。为了更方便地排查问题,从命令提示符启动 MySQL 服务器,以便看到发生了什么。If something goes wrong when InnoDB attempts to
initialize its tablespace or its log files, delete all files
created by InnoDB: all
ibdata files and all redo log files
(#ib_redo files).
If you created any NInnoDB tables, also delete
any .ibd files from the MySQL database
directories. Then try initializing InnoDB
again. For easiest troubleshooting, start the MySQL server from a
command prompt so that you see what is happening.
运行时问题Runtime Problems
如果 InnoDB 在文件操作期间打印操作系统错误,通常该问题有以下解决方案之一:If InnoDB prints an operating system error
during a file operation, usually the problem has one of the
following solutions:
确保
InnoDB数据文件目录和InnoDB日志目录存在。Make sure theInnoDBdata file directory and theInnoDBlog directory exist.确保 mysqld 有权在这些目录中创建文件。Make sure mysqld has access rights to create files in those directories.
确保 mysqld 可以读取正确的
my.cnf或my.ini选项文件,从而以你指定的选项启动。Make sure mysqld can read the propermy.cnformy.inioption file, so that it starts with the options that you specified.确保磁盘未满,且未超过任何磁盘配额。Make sure the disk is not full and you are not exceeding any disk quota.
确保为子目录和数据文件指定的名称不会冲突。Make sure that the names you specify for subdirectories and data files do not clash.
仔细检查
innodb_data_home_dir和innodb_data_file_path的语法。特别是,innodb_data_file_path选项中的任何MAX值都是硬性限制,超出该限制会导致致命错误。Doublecheck the syntax of theinnodb_data_home_dirandinnodb_data_file_pathvalues. In particular, anyMAXvalue in theinnodb_data_file_pathoption is a hard limit, and exceeding that limit causes a fatal error.