MySQL中BINARY怎么用( 二 )


`name` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1 rows in set (0.39 sec)
mysql
mysql desc select * from student where name = guo
+ -+ -+ + + + -+ + -+ + +
| id | select_type | table| type | possible_keys | key| key_len | ref| rows | Extra|
+ -+ -+ + + + -+ + -+ + +
| 1| SIMPLE| student | ref| idx_name| idx_name | 63| const | 1| Using where; Using index |
+ -+ -+ + + + -+ + -+ + +
1 rows in set (0.07 sec)
mysql
即可区分大小写:
mysql select * from student where name = guo
+ -+ +
| id | name |
+ -+ +
| 5| guo|
+ -+ +
1 rows in set (0.07 sec)
mysql select * from student where name = Guo
+ -+ +
| id | name |
+ -+ +
| 6| Guo|
+ -+ +
1 rows in set (0.06 sec)
mysql
【MySQL中BINARY怎么用】感谢各位的阅读!关于“MySQL中BINARY怎么用”这篇文章就分享到这里了,希望

推荐阅读