Created
September 16, 2013 14:39
-
-
Save ghostrocket/6581566 to your computer and use it in GitHub Desktop.
Fix Busted Characters after converting mysql db from latin1_swedish to utf8
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
mysql -uroot --password= --skip-column-names -e "select concat('update ', a.table_name, ' set ', a.column_name, ' = convert(cast(convert(', a.column_name, ' using latin1) as binary) using utf8);') from information_schema.columns a where a.table_schema = '$DB_SCHEMA';" > fixutf8.sql | |
mysql -uroot --password= $DB_SCHEMA < fixutf8.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment