-
-
Save dannygsmith/9e5a57f5fa22f6c47723e4385142b80e to your computer and use it in GitHub Desktop.
Revisions
-
robinnorth revised this gist
Jul 27, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,10 @@ DB="your_database_name" USER="your_db_user" PASS="your_db_pass" HOST="database_hostname" ( echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;' mysql -p $PASS -u $USER -h $HOST "$DB" -e "SHOW TABLES" --batch --skip-column-names \ | xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) \ | mysql -p $PASS -u $USER -h $HOST "$DB" -
robinnorth created this gist
Jun 25, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ DB="your_database_name" USER="your_db_user" PASS="your_db_pass" ( echo 'ALTER DATABASE `'"$DB"'` CHARACTER SET utf8 COLLATE utf8_general_ci;' mysql -p$PASS -u $USER "$DB" -e "SHOW TABLES" --batch --skip-column-names \ | xargs -I{} echo 'ALTER TABLE `'{}'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' ) \ | mysql -p$PASS -u $USER "$DB"