1
create database mysqltest collate = utf8_bin;
2
show create database mysqltest;
3
Database Create Database
4
mysqltest CREATE DATABASE `mysqltest` COLLATE = utf8_bin
6
create table t1 (a varchar(10));
7
create table t2 (a varchar(10)) collate = utf8_general_ci;
8
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
9
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
10
select * from t1 order by a;
18
select * from t2 order by a;
28
t1 CREATE TABLE `t1` (
29
`a` varchar(10) COLLATE utf8_bin DEFAULT NULL
33
t2 CREATE TABLE `t2` (
34
`a` varchar(10) DEFAULT NULL
36
select count(*) from t1 where a='a';
39
select count(*) from t2 where a='a';
42
select count(*) from t1 where a like 'a%';
45
select count(*) from t2 where a like 'a%';
48
drop table if exists t1;
49
drop table if exists t2;
50
drop database if exists mysqltest;