Created
February 11, 2018 03:09
-
-
Save unpluggedcoder/c151b5b4ae6f814cc602f423e5c64c92 to your computer and use it in GitHub Desktop.
[MySQL CONVERT CHARACTER SET to utf8 for all tables] Generate query for convert character set to utf8 for all tables #mysql #characterset
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_unicode_ci;") AS ExecuteTheString | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA="[YOUR DATABASE NAME]" | |
AND TABLE_TYPE="BASE TABLE"; | |
SELECT @@character_set_database, @@collation_database; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment