Created
August 30, 2013 22:08
-
-
Save jbonney/6394782 to your computer and use it in GitHub Desktop.
Convert MySQL default character set (encoding) from latin1 to utf8.
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
| mysqldump --user="username" --password="password" -c -e --default-character-set=utf8 --single-transaction --skip-set-charset --add-drop-database -B "database_name" > dump.sql | |
| sed 's/DEFAULT CHARACTER SET latin1/DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci/' <dump.sql | sed 's/DEFAULT CHARSET=latin1/DEFAULT CHARSET=utf8/' >dump-fixed.sql | |
| mysql --user="username" --password="password" < dump-fixed.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment