Adjust the MYSQL checking rule gbk_bin to binary storage. gbk_chinese_ci is case-insensitive. server adjustment [mysqld] default-character-set = gbk # add this item to MySQL 5.5 -- default-character-set is removed in MySQL. default-collation = gbk_bin # Add this character-set-server = gbk for MYSQL5.1 # Add this collation-server = gbk_bin for MYSQL5.5 # add this item for MYSQL5.5 but create if COLLATTION is not specified for the database, by default, gbk_chinese_ci www.2cto.com 2 is inherited from the server. the client adjusts mysql> show variables like 'collation _ % ';# + Before adjustment + | variable_name | value | ---------------------------------------------- collation_connection | gbk_chinese_ci | ---------------------------------------------- collation_database | gbk_bin | --> after the server is adjusted (before adjustment, it is gbk_chinese_ci) | -------------------------------------------- collation_server | gbk_bin | --> after the server is adjusted (before the adjustment, it is gbk_chinese_ci) | ----------------------------- ----------------- Mysql> set names 'gbk' collate 'gbk _ bin'; # After adjustment, let's look at the following mysql> show variables like 'collation _ % '; + rows + | variable_name | value | ---------------------------------------------- collation_connection | gbk_bin | ---------------------------------------------- collation_database | gbk_bin | ---------------------------------------------- collation_server | gb K_bin | ---------------------------------------------- www.2cto.com 3. you can use the command to check the rules for mysql> show full columns from tbz; 4. create database if not exists test default character set gbk COLLATE gbk_bin; create table 'tbz' ('bz' varchar (3) not null, 'bzmc 'varchar (16) not null, 'bzbm' varchar (1) default null, 'sm 'varchar (20) default null, primary key ('bz ')) ENGINE = InnoDB default charset = gbk COLLATE gbk_bin; 5. How can I change the default value of the current default rule ?? Mysql> show collation like 'gbk % '; + domains www.2cto.com | Collation | Charset | Id | Default | Compiled | Sortlen | bytes | gbk_chinese_ci | gbk | 28 | YES | 1 | gbk_bin | gbk | 87 | | YES | 1 | ------------------------------------------- ---------------------------------------- 6. character encoding and verification rules priority MySQL Character Set and verification rules have four levels of default settings: server level, database level, table level, and field level. We recommend that you specify character sets and verification rules when creating a database to avoid being affected by default values. Author Cai lei