from MySQL Server A
mysqldump -uroot -p db_name | sed -e 's/CHARSET=latin1/CHARSET=utf8' -e 's/\\//' | iconv -cfbig5 -tutf8 > db_name.sql
to MySQL Server B
echo SET NAMES utf8; >> new_db_name.sql
cat db_name.sql >> new_db_name.sql
mysql -uroot -p < new_db_name.sql
Leave a comment