mysql批量修改表引擎

[sql]
#查询表引擎

SELECT CONCAT(table_name,' ', engine)
FROM information_schema.tables WHERE ENGINE="MyISAM";
#生成修改sql
SELECT CONCAT('ALTER TABLE ',table_name,' ENGINE=InnoDB;') FROM information_schema.tables
WHERE ENGINE="MyISAM";
[/sql]
结果:
[sql]
ALTER TABLE t_config ENGINE=InnoDB;
ALTER TABLE t_dic ENGINE=InnoDB;
ALTER TABLE t_files ENGINE=InnoDB;
[/sql]

阅读剩余
THE END