latin1 (swedish_ci) to utf-8 (general ci) conversion in MySQL 5?

Hi,

Could someone tell me the easiest way to convert a MySQL 5 database (including all tables and content) from latin1 with the default swedish collation to utf-8 with the general collation.

I know this has been asked before, but the answer seems to depend on the MySQL and PHPMyAdmin version thats being used. I’m currently running PHPMA 2.7.0-pl2 and MySQL 5.0.19.

Any help would be appreciated.

Cheers.

the latin1 and utf8 collations are directly compatible. simply changing the table collation to utf8 should do the trick.

Thanks for the reply. So I can change the collation for each table in PHPMyAdmin and that takes care of the collation issue. But I’m still confused. I want the DB and all content and tables to use the Unicode character set and the utf8_general_ci collation.

If I change the collation I presume this doesn’t change the character set?
How do I tell which character set is being used via PHPMA?
And how do I change it if needed?
Does the data within the tables also need to be converted or is that taken care of when the tables/DB are changed?

Thanks.

collation depend on a specific character set. you can not have a utf8 collation with latin1 characters. when you change the table or column collation, mysql will map the characters from one character set to the other.

Cheers dude :slight_smile: