I was a project that’s run on live and client want from me this project enhance with the internationalization and localization features, But MySQL database has default collation for latin1 is ‘latin1_swedish_ci’. So I want to change it with character set and collation utf8_general_ci .I solved this by…..

I change the character set and collation of a database by using the following MySQL command:

ALTER DATABASE db_name CHARACTER SET utf8 COLLATE utf8_general_ci;

I change the character set and collation of each table by using the following MySQL command:

ALTER TABLE TableName CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci

I believe help this.

Advertisements