Home  >  Q&A  >  body text

Will changing the MYSQL table engine from MYISAM to INNODB cause data corruption?

I have a simple question. I have a mysql database. I have 2 tables using MYISAM that I want to change to INNODB, one of the tables has 1.000 rows, if I do this change, is there a risk of my data/rows getting corrupted?

P粉412533525P粉412533525385 days ago351

reply all(1)I'll reply

  • P粉005134685

    P粉0051346852023-09-07 11:30:04

    Changing the MySQL table engine from MyISAM to InnoDB may introduce the risk of data corruption. This is because InnoDB and MyISAM use different storage mechanisms, and converting a table from one engine to the other may result in data loss or corruption if the conversion process does not complete successfully.

    However, in your case, the table you are converting only has 1,000 rows, so the risk of data corruption is relatively low. As a precaution, it's still a good idea to back up the table before making changes. You can use the MySQL BACKUP TABLE command to create a backup of a table. After creating the backup, you can use the ALTER TABLE command to change the table engine to InnoDB.

    reply
    0
  • Cancelreply