问题描述:
'aamkadexm2m5njq2lwuzyzctndfkmc1h',
'aamkadexm2m5njq2lwuzyzctndfkmc1h'.
原来mysql查询时,存在不区分大小写的情况。可以通过binary关键字加以解决。
解决方法有两种:
第一种:让mysql查询时区分大小写

select * from usertable where binary id='aamkadexm2m5njq2lwuzyzctndfkmc1h';
第二种:在建表时加以标识

create table `usertable`(
`id` varchar(32) binary,
primary key (`id`)
) engine=innodb default charset=utf8;
或

create table `usertable` (
`id` varchar(32) character set utf8 collate utf8_bin not null default '',
在mysql中,存在大小写问题的地方还有:
(1) 关键字: 不区分大小写 select * from table_name 和 select * from table_name 效果是一样的
(3) 表的别名:不区分大小写 select m.* from users m where m.username = 'aa';
(4) 列的别名:不区分大小写 select uname from (select username as uname from users where id = 768) ;