Convert a Mysql database from latin to UTF-8

Posted by Matthieu on Stack Overflow See other posts from Stack Overflow or by Matthieu
Published on 2010-03-30T09:10:13Z Indexed on 2010/03/30 9:13 UTC
Read the original article Hit count: 459

Filed under:
|
|

I am converting a website from ISO to UTF-8, so I need to convert the Mysql database too.

On internet, I read various solutions, I don't know wich one to choose.

Do I really need to convert my varchar columns to binary, then to utf8 like that :

ALTER TABLE t MODIFY col BINARY(150);
ALTER TABLE t MODIFY col CHAR(150) CHARACTER SET utf8;

This is long to do that for each column, of each table, of each database.

I have 10 database, wich 20 tables each, wich around 2 - 3 varchar colums (2 queries each column), this gives me around 1000 queries to write ! How come ? How to do ?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about utf-8