Converting MySQL tables to utf8 encoding format

by itwebresources on September 28, 2012

How to convert MySQL tables to utf8 encoding format?

Solution:

ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

If you already have MySQL database dump containing characters written in some other character encoding type the solution would be this:

alter table TABLE_NAME modify FIELD_NAME blob;
alter database DATABASE_NAME charset=utf8;
alter table TABLE_NAME modify FIELD_NAME varchar(255) character set utf8;

This forces MySQL to convert the binary format into varchar using character set utf8.

Share this article

{ 2 comments… read them below or add one }

ITfreakz October 5, 2012 at 12:26 pm

very cool thanks I finally fixed my website with this…

Reply

itwebresources itwebresources October 5, 2012 at 12:27 pm

glad that this worked for you :)

Reply

Leave a Comment

Previous post:

Next post: