Are there any pitfalls / things you need to know when changing from MyISAM to InnoDB

后端 未结 6 1050
遇见更好的自我
遇见更好的自我 2021-02-01 11:02

One of my projects use the MyISAM engine in MySQL, but I\'m considering changing it to InnoDB as I need transaction support here and there.

  • What should I look at o
6条回答
  •  不思量自难忘°
    2021-02-01 11:15

    Just altering the table and setting the engine should be fine.

    • One of the big ones to watch out for is that select count(*) from MyTable is much slower in InnoDB than MyISAM.
    • auto_increment values will reset to the highest value in the table +1 after a server restart -- this can cause funny problems if you have a messy db with some deletes.
    • Optimum server settings are going to be different to a mainly MyISAM db.
    • Make sure the size of the innodb file is big enough to hold all your data or you'll be crucified by constant reallocation when you change the engines of the tables.

提交回复
热议问题