Created
November 16, 2015 11:18
-
-
Save khanhicetea/785b77d5e9222f231902 to your computer and use it in GitHub Desktop.
MySQL changing to UTF8
This file contains hidden or 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
-- Ref : http://stackoverflow.com/a/19301922 | |
SELECT CONCAT("ALTER TABLE `",TABLE_SCHEMA,"`.`",TABLE_NAME,"` CHARACTER SET utf8 COLLATE utf8_unicode_ci;", | |
"ALTER TABLE `",TABLE_SCHEMA,"`.`",TABLE_NAME,"` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;") | |
AS `alter_sql` | |
FROM `information_schema`.TABLES | |
WHERE TABLE_SCHEMA = 'db_name'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment