utf8mb4_general_ci
select SCHEMA_NAME,DEFAULT_CHARACTER_SET_NAME,DEFAULT_COLLATION_NAME from INFORMATION_SCHEMA.SCHEMA
show variables like 'collation_database';
ci不区分大小写
show VARIABLES like "char%";
set names 'utf8' collate 'utf8_unicode_ci';
mysql> select 'a' = 'A'; |
---|
'a' = 'A' |
1 |
1 row in set (0.00 sec)
cs区分大小写
latin1_general_cs 是会区分大小写的,
mysql> set names 'latin1' collate 'latin1_general_cs';
mysql> select 'a' = 'A'; |
---|
'a' = 'A' |
0 |
1 row in set (0.00 sec)
mysql> select 'a' > 'A'; |
---|
'a' > 'A' |
1 |
1 row in set (0.00 sec)
查看字符集,和排序规则:
show character set;