Last active
April 17, 2018 13:09
-
-
Save filipeandre/1bada71a9e827ebd84b37452df70e2cd to your computer and use it in GitHub Desktop.
Convert all tables to utf8_general_ci
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_NAME, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) AS 'Copy & run these SQL statements:' | |
FROM | |
INFORMATION_SCHEMA.TABLES | |
WHERE | |
TABLE_SCHEMA = "database_name" | |
AND TABLE_COLLATION != "utf8_general_ci" | |
AND TABLE_TYPE = "BASE TABLE"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment