关于mysql 查询内容不区分大小问题

问题描述:

  select * from users where user_name ='user_01' 跟 select * from users where user_name ='uSer_01',select * from users where user_name ='uSEr_01' 等等的查询结果一样,我们发现只是查询的字母大小写不一样,但是查询结果却相同。

这是mysql 默认设置,只要加入 binary 就可以解决这个问题

select * from users where binary  user_name ='user_01'   这样就是唯一的了


 

posted @ 2016-10-09 14:37  城市那么空  阅读(180)  评论(0)    收藏  举报