mysql innodb myisam 格式转换

PHPABC Mysql 939 次浏览 , , 没有评论

innodb 转换为 myisam

SELECT  CONCAT('ALTER TABLE ', TABLE_NAME, ' ENGINE=MyISAM;') AS sql_statements  INTO OUTFILE '/tmp/result.txt'
FROM    information_schema.TABLES AS tb
WHERE   table_schema = 'TableName'
AND     `ENGINE` = 'InnoDB'
AND     `TABLE_TYPE` = 'BASE TABLE'
ORDER BY TABLE_NAME DESC;
 
SOURCE /tmp/RESULT.txt;

myisam 转换为 innodb

SELECT  CONCAT('ALTER TABLE ', TABLE_NAME, ' ENGINE=InnoDB;') AS sql_statements  INTO OUTFILE '/tmp/result.txt'
FROM    information_schema.TABLES AS tb
WHERE   table_schema = 'TableName'
AND     `ENGINE` = 'MyISAM'
AND     `TABLE_TYPE` = 'BASE TABLE'
ORDER BY TABLE_NAME DESC;
 
SOURCE /tmp/RESULT.txt;

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Go