I have a django project that uses MyISAM
tables. When I perform a backup, I have heard that it is recommended to use InnoDB
tables rather than the MyISAM
. What is the reason why this is suggested and is it imperative that I use InnoDB
for backup?
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?
The recommendation is more for data security - MyISAM tables are known to be less tolerant to faults (ie machine crashes etc)
To change the table types you would have to take you app offline and use ALTER TABLE tablename 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
Note there may be performance decrease in your application after and there still can be issues because it obviously wasnt designed to use transactions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.