Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL convert table from Latin1 to utf8

Tags:

mysql

I need to convert a table with a lot of data from Latin1 to utf8 so that it can accept Korean characters. How do I alter that table without corrupting the data that's in there? What would my SQL statement be? What's the best way to proceed?

like image 923
sehummel Avatar asked Apr 18 '11 20:04

sehummel


2 Answers

ALTER TABLE database_name.table_name CONVERT TO CHARACTER SET utf8;

like image 71
Tass Avatar answered Oct 29 '22 09:10

Tass


Export (dump) the database, and reimport it with the new encoding.

http://alexking.org/blog/2008/03/06/mysql-latin1-utf8-conversion

like image 35
leonbloy Avatar answered Oct 29 '22 07:10

leonbloy