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!
Change Database Character encoding
Moderator: General Moderators
Re: Change Database Character encoding
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
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.
[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.