My Database Tables Revert to MyISAM Instead of InnoDB (MySQL) I am trying to change my tables engine to InnoDB because I am experiencing problems with the current engine which is inconsistent and crashes often. Unfortunately, it reverts back to MyISAM. This is the query that I am running:

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


What could I be missing or doing wrong?
You need USE my_database; before, so that you will be in that database.

The SELECT generates a bunch of ALTERs, but does not perform them.  To perform them:

Plan A:  (Straightforward)  Copy &amp; Paste them into mysql commandline tool or suitable window in some UI.

Plan B:  Build a Stored Procedure that loops ('cursor') through the output to prepare/execute/deallocate-prepare each one.