0

In phpMyAdmin the code below just outputs a list of sql statements for each table:

SET @DATABASE_NAME = 'my_db';
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;

How would I actually execute this to change all the tables? I've seen people say "batch" but I'm not sure if that is what I'm looking for.

0

It is actually easiest to simply copy&paste the SQL statements. Don't bother with trying to find and "eval".

It is even easier in the mysql commandline tool.

Here are my tips on gotchas that sometimes occur in the conversion from MyISAM to InnoDB: http://mysql.rjweb.org/doc.php/myisam2innodb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.