mysql> set global character_set_server=latin1 You specify this when you create the schema. You can define the default character set for all new tables in a given schema. If you change this dynamically be sure to include the option in your my.cnf to ensure this option is persisted for a mysqld restart. Mysql> create table test2(c1 varchar(10) not null) Mysql> set session character_set_server=utf8 mysql> set global character_set_server=utf8 If you want all tables in your instance to always be a default of utf8, you can changed the server variable character_set_server. mysql> create table test1(c1 varchar(10) not null) If not specified, this is what you will get. In MySQL 5.1, the default character set is latin1. MySQL defines the character set at 4 different levels for the structure of data. Continuing on from preparation in our MySQL latin1 to utf8 migration let us first understand where MySQL uses character sets.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |