Skip to content

Instantly share code, notes, and snippets.

@yarastqt
Created March 20, 2017 13:49
Show Gist options
  • Save yarastqt/d5069af34bee1426cac83ab12d874679 to your computer and use it in GitHub Desktop.
Save yarastqt/d5069af34bee1426cac83ab12d874679 to your computer and use it in GitHub Desktop.
SELECT CONCAT('ALTER TABLE `', t.`TABLE_SCHEMA`, '`.`', t.`TABLE_NAME`, '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;') as sqlcode
FROM `information_schema`.`TABLES` t
WHERE 1
AND t.`TABLE_SCHEMA` = 'db_name'
ORDER BY 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment