MySQL latin1 to UTF-8

| | Comments (0)

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

凱莉手工坊

凱莉手工坊

November 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          

About this Entry

This page contains a single entry by Pank published on November 3, 2009 1:38 PM.

MBR 2T Limit was the previous entry in this blog.

Utilities and SDK for Subsystem for UNIX-based Applications is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.