memo.xight.org

日々のメモ

MyISAM から InnoDB への移行

/etc/mysql/my.cnf

# InnoDB plugin enable
ignore_builtin_innodb
plugin-load=innodb=ha_innodb_plugin.so

default_storage_engine = InnoDB
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_flush_method = O_DIRECT

MySQLの再起動

/etc/init.d/mysql restart

InnoDBが有効になっているか確認

mysql> SHOW VARIABLES LIKE 'innodb%';
| innodb_file_format        | Barracuda     |
| innodb_file_format_check  | ON            |
| innodb_file_format_max    | Barracuda     |
| innodb_file_per_table     | ON            |
| innodb_flush_method       | O_DIRECT      |

ALTER TABLE の実行

ALTER TABLE tablename ENGINE InnoDB ROW_FORMAT=Compressed;