简体   繁体   English

MySQL备份MyISAM与InnoDB

[英]MySQL backups MyISAM vs. InnoDB

I have a django project that uses MyISAM tables. 我有一个使用MyISAM表的django项目。 When I perform a backup, I have heard that it is recommended to use InnoDB tables rather than the MyISAM . 当我执行备份时,我听说建议使用InnoDB表而不是MyISAM What is the reason why this is suggested and is it imperative that I use InnoDB for backup? 建议这样做的原因是什么?我必须使用InnoDB进行备份吗?

Currently, I'm using the following for backup: 目前,我正在使用以下内容进行备份:

mysqldump -v -u $USER --password=$PASSWORD $DB >$BACKUP_FOLDER/$BACKUP_FILENAME

How would I convert this to InnoDB and do a backup? 如何将其转换为InnoDB并进行备份?

The recommendation is more for data security - MyISAM tables are known to be less tolerant to faults (ie machine crashes etc) 推荐更多关于数据安全性的信息-已知MyISAM表对错误的容忍度较低(例如,机器崩溃等)

To change the table types you would have to take you app offline and use ALTER TABLE tablename ENGINE=InnoDB; 要更改表类型,您必须使应用程序脱机并使用ALTER TABLE表名ENGINE = InnoDB;

With large tables you need at least twice as much disk space and it is possible to take many days if you are talking 100's millions of rows 对于大型表,您至少需要两倍的磁盘空间,并且如果要谈论100亿行,可能要花费很多天

Note there may be performance decrease in your application after and there still can be issues because it obviously wasnt designed to use transactions. 请注意,此后您的应用程序可能会降低性能,并且仍然存在一些问题,因为它显然不是为使用事务而设计的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM