单数据库更改形式
SELECT CONCAT('ALTER TABLE DBNAME.', table_schema.table_name, ' ENGINE=InnoDB;') AS ExecuteTheseSQLCommandsFROM information_schema.tables WHERE table_schema = 'DBNAME'ORDER BY table_name DESC; |
多数据库批量更改形式
select concat('alter table ',table_name, ' engine = innodb;')from information_schema.tableswhere table_schema in ('db1','db2',....,'dbN') |
查询出结果,复制粘贴执行转换~