Skip to content

Instantly share code, notes, and snippets.

@didip
Created November 11, 2009 00:40
Show Gist options
  • Save didip/231446 to your computer and use it in GitHub Desktop.
Save didip/231446 to your computer and use it in GitHub Desktop.
mysqldump --user=root --default-character-set=latin1 -c --insert-ignore --skip-set-charset <dbname> <table-name> > <filename>.sql &&
iconv -f ISO-8859-1 -t UTF-8 <filename>.sql > <filename>.utf8.sql &&
perl -pi -w -e 's/CHARSET=latin1/CHARSET=utf8/g;' <filename>.sql.utf8.sql &&
mysql --user=root --max_allowed_packet=16M --default-character-set=utf8 <dbname> < <filename>.utf8.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment