1. True connection modification. It is slower when there is more data, and can affect read performance when modified. My_table is the table of operations, InnoDB is the new storage engine.
| The code is as follows |
Copy Code |
ALTER TABLE my_table engine=innodb2. |
Export, import. This is easier to operate, directly to the lead out of the SQL file to change, and then guide back. With Mysqldump, Feng elder brother is commonly used is navicate so easier to use. Friendship Alert is a big risk.
3. Create, insert. This is faster than the first, safety is higher than the second, recommended. 2-Step operation
A. Create a table, first create a table that is the same as the table you want to manipulate, and then change the storage engine as the target engine.
| The code is as follows |
Copy Code |
CREATE TABLE my_tmp_table like my_table; ALTER TABLE my_tmp_table Engine=innodb; |
B. Insert. For security and speed, it is best to add transactions and limit the scope of the ID (primary key).
| The code is as follows |
Copy Code |
INSERT into my_tmp_table SELECT * from my_table; |
All right, MySQL. Modify table storage Engine practice here, the final method is to use the temporary table to do, of course, if you do not want to do this can first back up the data, and then use the first method to modify Oh.