Cam*_*rzt 7 mysql innodb recovery corruption amazon-rds
因此,我在 RDS 中的生产数据库显然在版本更新期间崩溃或重新启动,并且在重新启动后 mysql 无法加载 innodb 表之一:正如日志中的以下错误所证明的那样。
140324 16:22:23 [ERROR] Cannot find or open table dbname/table_name from
the internal data dictionary of InnoDB though the .frm file for the
table exists. Maybe you have deleted and recreated InnoDB data
files but have forgotten to delete the corresponding .frm files
of InnoDB tables, or you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support.
See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html
how you can resolve the problem.
Run Code Online (Sandbox Code Playgroud)
问题是三天没有人注意到表丢失了,因此我的自动快照没有用(我只保留它们那么长时间),因为所有快照都有相同的问题。
在我尝试修复问题的过程中,我从数据库中得到了一些迹象,表明 .frm 和 .ibd 文件都已就位。该show tables
命令列出了该表(因此 frm 存在),如果我(在副本上)删除该表并尝试重新创建它,则会出现以下错误。
140324 16:46:05 InnoDB: Error creating file './dbname/table_name.ibd'.
140324 16:46:05 InnoDB: Operating system error number 17 in a file operation.
InnoDB: Error number 17 means 'File exists'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/operating-system-error-codes.html
InnoDB: The file already exists though the corresponding table did not
InnoDB: exist in the InnoDB data dictionary. Have you moved InnoDB
InnoDB: .ibd files around without using the SQL commands
InnoDB: DISCARD TABLESPACE and IMPORT TABLESPACE, or did
InnoDB: mysqld crash in the middle of CREATE TABLE? You can
InnoDB: resolve the problem by removing the file './dbname/table_name.ibd'
InnoDB: under the 'datadir' of MySQL.
Run Code Online (Sandbox Code Playgroud)
我怀疑在实例重新启动之前索引存在一些问题,或者如果它确实崩溃了,那么可能会导致损坏。
我设法从日志中重新创建了数据(可能),尽管这只是一个猜测,而不是确定的事情。
所以我在问我现在应该做什么。我很想找到一个解决方案,让我可以用它拥有的数据取回该表,但如果我必须删除它并重新创建它,那也没关系。显然我不能接触任何 mysql 数据文件,因为它是一个 rds 实例。Mysql 版本是 5.5.27。
归档时间: |
|
查看次数: |
931 次 |
最近记录: |