Reputation: 71
I wonder if I convert some tables from MyISAM to InnoDB, will it cause any corruptions of data?
I am in need to convert some tables to InnoDB so I can use transaction, but they are holding very important data so I'm not sure if I should do the conversion or not.
Upvotes: 7
Views: 2075
Reputation: 117353
MySQL has designed it so that converting between table types is designed to be robust.
The only risk to your data, other than the time it takes to do the conversion, is the normal background risk that you would have at any time your database is running. That is to say, you should always have backups anyway, and if not losing anything is important, you should probably have replication.
Upvotes: 0
Reputation: 13962
Of course there is always a risk of data loss; but overall I would consider it rather low.
When altering a table MySQL will work on a temporary copy for most operations, including this one. So if the operation fails it will not harm your original table.
And having a backup will make you feel better anyway...
Upvotes: 0
Reputation: 52372
While changing the database engine of a table is a simple and common task which should cause no corruption, the only way to guarantee no corruption can occur is to first make your own backup.
Upvotes: 7