Created
March 7, 2016 04:54
-
-
Save samsargent/244e0a66a7cf9134d884 to your computer and use it in GitHub Desktop.
Bulk update to utf8/utf8_general_ci database + tables
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
| DB="DBNAME"; ( echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;'; mysql -u root "$DB" -e "SHOW TABLES" --batch --skip-column-names | xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) | mysql -u root "$DB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment