我遇到了另一个用户在此处描述的相同数据库问题,我设法通过设置启动了 mysqld innodb_force_recovery = 6
,这使我可以使用mysqldump -u<username> -p -f --all-databases > all.sql
. 但是,此备份导致了一组错误消息:
mysqldump: Error 1034: Index for table <table1> is corrupt; try to repair it when dumping table <table1> at row: 0
mysqldump: Error 1034: Index for table <table2> is corrupt; try to repair it when dumping table <table2> at row: 6
mysqldump: Error 1034: Index for table <table3> is corrupt; try to repair it when dumping table <table3> at row: 0
mysqldump: Error 1034: Index for table <table4> is corrupt; try to repair it when dumping table <table4> at row: 0
mysqldump: Error 1034: Index for table <table5> is corrupt; try to repair it when dumping table <table5> at row: 0
mysqldump: Error 1034: Index for table <table6> is corrupt; try to repair it when dumping table <table6> at row: 0
mysqldump: Error 1034: Index for table <table7> is corrupt; try to repair it when dumping table <table7> at row: 0
“尝试修复它”是否意味着mysqldump
实际上确实尝试修复它(并成功),或者它是否意味着我应该尝试修复它作为下一个动作,如果是这样,我需要什么命令现在发行?我需要重新运行吗mysqldump
?
“作为下一步行动,我应该尝试修复它” <- 这个。
mysqldump
/mariadb-dump
不尝试修复任何东西,它始终专注于倾倒。ER_NOT_KEYFILE
InnoDB 在某些情况下会产生错误,因此它不是 Aria/MyISAM 独有的错误。“REPAIR TABLE”未在 InnoDB 上实现,请尝试删除这些表上的索引并重新创建索引。
考虑将 --routines/ triggers 添加到您的 mysqldump。可能值得尝试使用此转储作为恢复机制,但首先复制(关闭时)当前数据目录。