标签:mysql 区分大小写
1
2
3
4
5
6
7
|
mysql>
create
table
t1( ->
name
varchar (10));
Query
OK, 0 rows
affected (0.09 sec) mysql>
insert
into
t1 values ( ‘you‘ ),( ‘You‘ ),( ‘YOU‘ );
Query
OK, 3 rows
affected (0.05 sec) Records:
3 Duplicates: 0 Warnings: 0 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
mysql>
select
* from
t1 where
name
= ‘you‘ ;
+ ------+
|
name
| + ------+
|
you | |
You | |
YOU | + ------+
3
rows
in
set
(0.00 sec) mysql>
select
* from
t1 where
name
= ‘YOU‘ ;
+ ------+
|
name
| + ------+
|
you | |
You | |
YOU | + ------+
3
rows
in
set
(0.00 sec) |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
mysql>
alter
table
t1 change name
name
varchar (10)
binary ;
Query
OK, 3 rows
affected (0.20 sec) Records:
3 Duplicates: 0 Warnings: 0 mysql>
select
* from
t1 where
name
= ‘you‘ ;
+ ------+
|
name
| + ------+
|
you | + ------+
1
row in
set
(0.00 sec) mysql>
select
* from
t1 where
name
= ‘YOU‘ ;
+ ------+
|
name
| + ------+
|
YOU | + ------+
1
row in
set
(0.00 sec) |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
mysql>
select
* from
t1 where
name
= binary
‘YOU‘ ;
+ ------+
|
name
| + ------+
|
YOU | + ------+
1
row in
set
(0.02 sec) mysql>
select
* from
t1 where
name
= binary
‘you‘ ;
+ ------+
|
name
| + ------+
|
you | + ------+
1
row in
set
(0.00 sec) |
1
2
3
|
[mysqld]
lower_case_table_names=1
(0:区分;1:不区分) |
1
2
3
4
5
6
7
|
mysql>
show variables like
‘%case_table%‘ ;
+ ------------------------+-------+
|
Variable_name | Value | + ------------------------+-------+
|
lower_case_table_names | 1 | + ------------------------+-------+
1
row in
set
(0.00 sec) |
标签:mysql 区分大小写
原文地址:http://blog.csdn.net/u013628152/article/details/44176219