create table (
)charset utf8;
charset utf8 。
-----------------------------------------------
:
mysql 。
,
,
,
,
, 。
1. , ?set character_set_client=utf8
2. , ?set character_set_connection=utf8
3. ?set character_set_results=utf8
N, set names N
------------------------------------------------------
:
UTF8 , UTF8_general_ci,
ASCII ,utf8_bin
?
create table()charset utf8 collate utf8_bin
: 。
1, , utf8_general_ci, :
create table tmp (name char(5));
insert into tmp values ('a'),("B"),("c"),("D");
select * from tmp order by name;
+------+
| name |
+------+
| a |
| B |
| c |
| D |
+------+
2, :
create table tmp (name char(5))charset utf8 collate utf8_bin;
insert into tmp values ('a'),("B"),("c"),("D");
select * from tmp order by name;
+------+
| name |
+------+
| B |
| D |
| a |
| c |
+------+