Page 1 of 1

Change Database Character encoding

Posted: Sun Oct 23, 2011 10:25 am
by Eric!
I'm trying to move a database into UTF8 and I thought about just changing the latin1's to utf8, but it seems there are several settings:

[text]Variable_name Value
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8[/text]

Also there are several collations as latin1_swedish_ci

Is there a preferred procedure for converting a database character set to all utf8? There seems to be a vary wide range of methods on the internet.

Thanks!

Re: Change Database Character encoding

Posted: Thu Oct 27, 2011 1:04 pm
by Eric!
Really? No suggestions? I'm hoping someone could save me some time so I don't try all the wrong things first.

Re: Change Database Character encoding

Posted: Sun Nov 06, 2011 10:04 pm
by Eric!
If anyone is interested
[text]CREATE DATABASE db_name
CHARACTER SET utf8
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
DEFAULT COLLATE utf8_general_ci
;

ALTER DATABASE db_name
CHARACTER SET utf8
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
DEFAULT COLLATE utf8_general_ci
;

ALTER TABLE tbl_name
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
;[/text]
I also edited the sql dump files to make sure multibyte and utf8 were properly replaced before re-importing them.