in Coding, Linux

Converting InnoDB to MyISAM

Problem:

Trying to convert from InnoDB to MyISAM for smaller RAM footprint MySQL on a tiny VPS

Solution:

adding skip-innodb on its own didn’t work, had to add:

default-storage-engine = MYISAM

skip-innodb

And then run:

CONVERT_SCRIPT=Convert_InnoDB_to_MyISAM.sql
mysql -u... -p... -AN -e"SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' ENGINE=MyISAM;') FROM information_schema.tables WHERE engine ='InnoDB';" > ${CONVERT_SCRIPT}
mysql -u... -p... -A < ${CONVERT_SCRIPT}