I wanted to upgrade my MythTV MySQL tables from MyISAM into InnoDB format. When I installed Mythbuntu 12.04, MyISAM was the default database engine. Now the default database engine moving forward in InnoDB. Here are the steps I took to upgrade using phpMyAdmin. I am not sure if I documented all the steps here, so use at your own risk.
- Instructions from Will Jones at http://stackoverflow.com/questions/3856435/how-to-convert-all-tables-from-myisam-into-innodb
- Login to phpMyAdmin
- Select database ‘mythconverg’
- Select “SQL” tab towards top of page.
- Input the following code in the input box labelled “Run SQL query/queries on database mythconverg”. Select the “Go” button to run the SQL query
- Select “SQL” tab towards top of page.
- Select database ‘mythconverg’
SET @DATABASE_NAME = 'mythconverg';
SELECT CONCAT('ALTER TABLE `', table_name, '` ENGINE=InnoDB;') AS sql_statements FROM information_schema.tables AS tb WHERE table_schema = @DATABASE_NAME AND `ENGINE` = 'MyISAM' AND `TABLE_TYPE` = 'BASE TABLE' ORDER BY table_name DESC;
- Copy the output from this query and paste these results back in the “Run SQL query/queries on database mythconverg” SQL query input box.