Skip to content

Instantly share code, notes, and snippets.

@diogopms
Last active February 18, 2018 17:46
Show Gist options
  • Save diogopms/257f8f34a904a9eeb06f to your computer and use it in GitHub Desktop.
Save diogopms/257f8f34a904a9eeb06f to your computer and use it in GitHub Desktop.
Fix character-set utf8 mysqldump mysql
time mysqldump -uroot -p --skip-set-charset --default-character-set=latin1 -h HOST TABLE | sed 's/CHARSET=latin1/CHARSET=utf8/g' > dump.sql
time mysql -uroot -p --default-character-set=utf8 -h HOST TABLE < dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment