Web Hosting Talk







View Full Version : Switching MySQL collation after a table is populated


jon31
09-15-2008, 01:40 PM
Hi folks,

I've just now realized that I'm having some database character issues because my tables are set to "latin1_swedish etc" instead of "utf8_unicode".

If I were to change the collation of my tables to utf8_unicode now, would it affect the data in my tables?

Any help would be greatly appreciate!

Thanks,
Jon

vibrokatana
09-15-2008, 07:08 PM
MySQL will try to convert it. That said making (and keeping) backups is a good idea. So you should make a backup before you do any major changes to your site/database.

azizny
09-17-2008, 10:39 AM
It won't work.

You need to create a new database, read in the values and convert them (possible using iconv) and then re-enter them again.

Peace,