生产需求:
将oldboy数据库下的所有1000表,存储引擎从MyISAM替换为innodb
select concat("alter table ",table_name," engine=innodb;")
from information_schema.ttables
where table_schema='oldboy'
into outfile '/tmp/alter.sql';
语句拼接 然后在外部执行脚本
生产需求:
将oldboy数据库下的所有1000表,存储引擎从MyISAM替换为innodb
select concat("alter table ",table_name," engine=innodb;")
from information_schema.ttables
where table_schema='oldboy'
into outfile '/tmp/alter.sql';
语句拼接 然后在外部执行脚本