1
create database mysqltest collate = utf8_bin;
2
show create database mysqltest;
3
Database Create Database
4
mysqltest CREATE DATABASE `mysqltest` COLLATE = utf8_bin
5
alter database mysqltest collate = utf8_general_ci;
6
show create database mysqltest;
7
Database Create Database
8
mysqltest CREATE DATABASE `mysqltest` COLLATE = utf8_general_ci
9
alter database mysqltest collate = utf8_bin;
10
show create database mysqltest;
11
Database Create Database
12
mysqltest CREATE DATABASE `mysqltest` COLLATE = utf8_bin
14
create table t1 (a varchar(10));
15
create table t2 (a varchar(10)) collate = utf8_general_ci;
16
insert into t1 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
17
insert into t2 values ('a'),('A'),('aA'),('Aa'),('ab'),('Ab');
18
select * from t1 order by a;
26
select * from t2 order by a;
36
t1 CREATE TABLE `t1` (
37
`a` VARCHAR(10) COLLATE utf8_bin DEFAULT NULL
38
) ENGINE=DEFAULT COLLATE = utf8_bin
41
t2 CREATE TABLE `t2` (
42
`a` VARCHAR(10) COLLATE utf8_general_ci DEFAULT NULL
43
) ENGINE=DEFAULT COLLATE = utf8_general_ci
44
select count(*) from t1 where a='a';
47
select count(*) from t2 where a='a';
50
select count(*) from t1 where a like 'a%';
53
select count(*) from t2 where a like 'a%';
56
drop table if exists t1;
57
drop table if exists t2;
58
drop database if exists mysqltest;