企业中如何批量更改mysql中表的存储引擎?

一、首先必须熟悉Mysql中有哪些基本的数据库,在mysql中database等价于schema,默认的基本库有四个:mysql,information_schema,performance_schema,sys。

 

 

二、sql语句如下:主要是获取某个库的所有表名,然后使用concat组合成一条条语句;

select concat( 'alter table ' ,table_name ,' engine=myisam; ')
from information_schema.tables t
where table_schema = '库名'
and table_type = 'base table';

posted @ 2018-05-07 15:54  igoodful  阅读(215)  评论(0编辑  收藏  举报