My Database Tables Revert to MyISAM Instead of InnoDB (MySQL)
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.