Home >Database >Mysql Tutorial >MySQL将某个数据库下的所有表的存储引擎修改为InnoDB类型语句_MySQL

MySQL将某个数据库下的所有表的存储引擎修改为InnoDB类型语句_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:26:301141browse

bitsCN.com

USE `[DBNAME]`;SELECT GROUP_CONCAT(CONCAT( 'ALTER TABLE ' ,TABLE_NAME ,' ENGINE=InnoDB; ')  SEPARATOR '' ) FROM information_schema.TABLES AS t  WHERE TABLE_SCHEMA = '[DBNAME]' AND TABLE_TYPE = 'BASE TABLE'

使用说明:

1. 将以上SQL语句中的[DBNAME]替换成需要修改的数据库名称。

2. 执行SQL,这个时候还没有修改,只是给了一个查询结果。

3. 将查询结果复制,去掉前后的引号,然后执行。

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn