Created
July 20, 2020 22:13
-
-
Save filipemansano/b0e646ba23222bd8591073c507675261 to your computer and use it in GitHub Desktop.
generate script to convert all tables to the same collation
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,"` COLLATE utf8mb4_0900_ai_ci;") AS ExecuteTheString | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_SCHEMA="[DATABASENAME]" | |
AND TABLE_TYPE="BASE TABLE"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment