MySQL 表的存储引擎不支持修复。InnoDB 还是 MyISAM?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10377334/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The storage engine for the table doesn't support repair. InnoDB or MyISAM?
提问by jaypabs
After repairing my database I received the following error:
修复我的数据库后,我收到以下错误:
scode_tracker.ap_visits
note : The storage engine for the table doesn't support repair
scode_tracker.visit_length
note : The storage engine for the table doesn't support repair
I found out that the type of table is InnoDB. The other table was MyISAM and it was repaired successfully.
我发现表的类型是 InnoDB。另一张表是MyISAM,修复成功。
After reading some topic here, the solution is to change it to MyISAM. I don't know much about InnoDB and MyISAM. I don't specify the type when I created the table. So my question is should I use MyISAM instead of InnoDB? If yes, how can I change it from InnoDB to MyISAM?
在这里阅读一些主题后,解决方案是将其更改为 MyISAM。我对 InnoDB 和 MyISAM 了解不多。我在创建表时没有指定类型。所以我的问题是我应该使用 MyISAM 而不是 InnoDB?如果是,如何将其从 InnoDB 更改为 MyISAM?
采纳答案by John Woo
回答by Immutable Brick
InnoDB works slightly different that MyISAM and they both are viable options. You should use what you think it fits the project.
InnoDB 的工作方式与 MyISAM 略有不同,它们都是可行的选择。您应该使用您认为适合项目的内容。
Some keypoints will be:
一些关键点将是:
- InnoDB does ACID-compliant transaction. http://en.wikipedia.org/wiki/ACID
- InnoDB does Referential Integrity (foreign key relations) http://www.w3resource.com/sql/joins/joining-tables-through-referential-integrity.php
MyIsam does full text search, InnoDB doesn't- I have been told InnoDB is faster on executing writes but slower than MyISAM doing reads (I cannot back this up and could not find any article that analyses this, I do however have the guy that told me this in high regard), feel free to ignore this point or do your own research.
- Default configuration does not work very well for InnoDB needs to be tweaked accordingly, run a tool like http://mysqltuner.pl/mysqltuner.plto help you.
- InnoDB 执行符合 ACID 的事务。http://en.wikipedia.org/wiki/ACID
- InnoDB 做Referential Integrity(外键关系)http://www.w3resource.com/sql/joins/joining-tables-through-referential-integrity.php
MyIsam 做全文搜索,InnoDB 不做- 有人告诉我 InnoDB 在执行写入时速度更快,但比 MyISAM 读取速度慢(我无法支持这一点,也找不到任何分析这一点的文章,但是我确实有一个高度重视这一点的人),请随时忽略这一点或做你自己的研究。
- InnoDB 的默认配置不能很好地工作,需要相应地进行调整,运行像http://mysqltuner.pl/mysqltuner.pl这样的工具来帮助你。
Notes:
笔记:
- In my opinion the second point is probably the one were InnoDB has a huge advantage over MyISAM.
Full text search not working with InnoDB is a bit of a pain,You can mix different storage engines but be careful when doing so.
- 在我看来,第二点可能是 InnoDB 比 MyISAM 具有巨大优势。
不使用 InnoDB 的全文搜索有点痛苦,您可以混合使用不同的存储引擎,但这样做时要小心。
Notes2: - I am reading this book "High performance MySQL", the author says "InnoDB loads data and creates indexes slower than MyISAM", this could also be a very important factor when deciding what to use.
注释2: - 我正在阅读“高性能 MySQL”这本书,作者说“InnoDB 加载数据和创建索引的速度比 MyISAM 慢”,这在决定使用什么时也可能是一个非常重要的因素。
回答by kumiduck
You have the wrong table set on the command. You should use the following on your setup:
您在命令中设置了错误的表。您应该在设置中使用以下内容:
ALTER TABLE scode_tracker.ap_visits ENGINE=MyISAM;