Changing table type from MyISAM to InnoDB
Asked Answered
F

3

7

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.

Fill answered 28/7, 2011 at 3:10 Comment(0)
O
7

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.

Oystercatcher answered 28/7, 2011 at 3:12 Comment(0)
T
0

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...

Temekatemerity answered 28/7, 2011 at 3:16 Comment(0)
S
0

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.

Soho answered 28/7, 2011 at 3:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.