I am having an issue with a MySQL database. I have two copies of it: development and production. Today I realised that:

  • The production database has the encoding format utf8_general_ci
  • The development database has the encoding format latin1_swedish_ci.

My question:

Is it possible to change the encoding of my development database to look like the production one? How can I perform that in a easy way?

And, for the noobs like me, what are the main differences between the two formats. Which one would you recommend? Which one is the most standard on the industry?

Thanks in advance.

有帮助吗?

解决方案

question 1: Yes, it's possible

ALTER DATABASE `test` CHARACTER SET utf8 COLLATE utf8_general_ci;

but You have to be carefull if nothing will change after switch. Only english, will change easyly... special characters could be a problem.

question 2: You have to read more: http://dev.mysql.com/doc/refman/5.5/en/charset-general.html because there are issues like sorting, charset range...

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top