Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a MySQL table that has a number of columns with the latin1 character set. Because of driver issues, the columns actually contain utf8 data. I want to leave the data as-is but change the column character set to UTF8.

Every solution I've examined does two alter table commands, changing the column to binary, then back to the previous type with the new character set.

There are multiple columns on multiple tables in multiple databases, so this approach would be pretty slow.

Is there a better way to get this done?

share|improve this question

1 Answer 1

The fastest way may be just doing a mysqldump and import with specific flags set. Check this blog: http://blog.hno3.org/2010/04/22/fixing-double-encoded-utf-8-data-in-mysql/

Some other alternative methods are listed here: http://en.gentoo-wiki.com/wiki/Convert_latin1_to_UTF-8_in_MySQL

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.