mysql批量修改数据库表引擎

数据库表之前的引擎是MyISAM,影响事务操作,要改成Innodb引擎

查询表引擎

SELECT CONCAT(table_name,'  ', engine)
      FROM information_schema.tables WHERE table_schema="表名" AND ENGINE="MyISAM";

生成修改sql

select CONCAT('alter table ',table_name,' engine=InnoDB;') FROM information_schema.tables WHERE table_schema="数据库名" AND ENGINE="MyISAM";

之后复制到文档里,把横杠去掉就可以执行了!

猜你喜欢

转载自www.cnblogs.com/fuyuteng/p/10874854.html