Tuesday, July 24, 2012

Convert MyISAM to InnoDB

This shows how to convert MyISAM to InnoDB engine from command line:


#mysql -p -e "show tables in <database_name>;" | tail --lines=+2 | xargs -i echo "ALTER TABLE {} ENGINE=INNODB;" > alter_table.sql


#mysql --database=<database_name> -p < alter_table.sql

No comments:

Post a Comment