Last active
December 19, 2015 00:28
-
-
Save simonkberg/5868471 to your computer and use it in GitHub Desktop.
All tables to InnoDB
Convert to UTF8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' ENGINE=InnoDB;') | |
FROM information_schema.tables | |
WHERE 1=1 | |
AND engine <> 'MyISAM' | |
AND table_schema NOT IN ('information_schema', 'mysql', 'performance_schema'); | |
SELECT CONCAT('ALTER TABLE ',table_schema,'.',table_name,' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') | |
FROM information_schema.tables | |
WHERE 1=1 | |
AND collate <> 'utf8_general_ci'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment